Revision: 1740
          http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1740&view=rev
Author:   jcsjcs
Date:     2007-10-26 19:48:08 -0700 (Fri, 26 Oct 2007)

Log Message:
-----------
  * configure.in
    src/mp4file.c: recognize if additional argument is needed for
    MP4GetMetadataFreeForm() and MP4GetMetadataCoverArt(). Thanks to
    Felix Homann.

Modified Paths:
--------------
    gtkpod/trunk/ChangeLog_detailed
    gtkpod/trunk/configure.in
    gtkpod/trunk/src/mp4file.c

Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed     2007-10-27 02:36:49 UTC (rev 1739)
+++ gtkpod/trunk/ChangeLog_detailed     2007-10-27 02:48:08 UTC (rev 1740)
@@ -1,8 +1,13 @@
 2007-10-27 Jorg Schuler <jcsjcs at users.sourceforge.net>
 
   * src/fetchcover.c (fetchcover_cleanup): function only used if curl
-    is available -- avoid compilation warning
+    is available -- avoid compilation warning.
 
+  * configure.in
+    src/mp4file.c: recognize if additional argument is needed for
+    MP4GetMetadataFreeForm() and MP4GetMetadataCoverArt(). Thanks to
+    Felix Homann.
+
 2007-10-27 P.G. Richardson <phantom_sf at users.sourceforge.net>
 
   * src/display_coverart.c

Modified: gtkpod/trunk/configure.in
===================================================================
--- gtkpod/trunk/configure.in   2007-10-27 02:36:49 UTC (rev 1739)
+++ gtkpod/trunk/configure.in   2007-10-27 02:48:08 UTC (rev 1740)
@@ -152,7 +152,29 @@
     if test "x$have_mp4v2_header" = "xno"; then
         have_mp4v2="no"
         AC_MSG_WARN([mp4.h cannot be found or is unusable. Check your mp4v2 
installation.])
+    else 
+    AC_TRY_COMPILE( [#include <mp4.h> ],
+        [bool TestMP4GetMetadataFreeForm(MP4FileHandle hFile, const char *name,
+            u_int8_t** pValue, u_int32_t* valueSize, const char *owner)
+            {
+                MP4GetMetadataFreeForm(hFile, name,pValue, valueSize, owner);
+            } ], freeform_accepts_extra_arg=yes)
+    AC_TRY_COMPILE( [#include <mp4.h>],
+        [bool TestMP4GetMetadataCoverArt(MP4FileHandle hFile,
+            u_int8_t **coverArt, u_int32_t* size, uint32_t index)
+            {
+                MP4GetMetadataCoverArt(hFile, coverArt, size, index);
+            }], coverart_accepts_extra_arg=yes)
+
+    if test "x$freeform_accepts_extra_arg" = "xyes"; then
+        AC_DEFINE(FREEFORM_ACCEPTS_EXTRA_ARG, 1,[libmp4v2 probably version 1.6 
or higher: 
+                  MP4GetMetadataFreeForm accepts extra argument])
     fi
+    if test "x$coverart_accepts_extra_arg" = "xyes"; then
+        AC_DEFINE(COVERART_ACCEPTS_EXTRA_ARG, 1,[libmp4v2 probably version 1.6 
or higher: 
+                  MP4GetMetadataCoverArt accepts an extra argument] )
+    fi
+    fi
     if test "x$with_mp4v2" = "xyes" -a "x$have_mp4v2" = "xno"; then
         AC_MSG_ERROR([MP4/AAC support explicitly requested but libmp4v2 
couldn't be found])
     fi

Modified: gtkpod/trunk/src/mp4file.c
===================================================================
--- gtkpod/trunk/src/mp4file.c  2007-10-27 02:36:49 UTC (rev 1739)
+++ gtkpod/trunk/src/mp4file.c  2007-10-27 02:48:08 UTC (rev 1740)
@@ -139,6 +139,20 @@
 #include <string.h>
 #include "mp4.h"
 
+#ifndef FREEFORM_ACCEPTS_EXTRA_ARG
+/* Version 1.6 of libmp4v2 introduces an index argument for 
MP4GetMetadataFreeForm. For C++ sources it defaults
+   to 0, but in C we have to specify it on our own. 
+*/
+#define MP4GetMetadataFreeForm(mp4File, name, pValue, pValueSize, owner)  
MP4GetMetadataFreeForm(mp4File, name, pValue, pValueSize)
+#endif
+
+#ifndef COVERART_ACCEPTS_EXTRA_ARG
+/* Version 1.6 of libmp4v2 introduces an index argument for 
MP4GetMetadataCoverart. For C++ sources it defaults
+   to NULL, but in C we have to specify it on our own. 
+*/
+#define MP4GetMetadataCoverArt(hFile, coverArt, size, index) 
MP4GetMetadataCoverArt(hFile, coverArt, size)
+#endif
+
 static gboolean mp4_scan_soundcheck (MP4FileHandle mp4File, Track *track)
 {
     gboolean success = FALSE;
@@ -149,7 +163,7 @@
     g_return_val_if_fail (mp4File != MP4_INVALID_FILE_HANDLE, FALSE);
 
     if (MP4GetMetadataFreeForm(mp4File, "iTunNORM",
-                              &ppValue, &pValueSize))
+                              &ppValue, &pValueSize, NULL))
     {
        gchar *str;
        guint sc1=0, sc2=0;
@@ -171,7 +185,7 @@
     }
 
     if (MP4GetMetadataFreeForm(mp4File, "replaygain_track_gain",
-                              &ppValue, &pValueSize))
+                              &ppValue, &pValueSize, NULL))
     {
        gchar *str;
        gdouble rg;
@@ -367,7 +381,7 @@
                    u_int8_t *image_data;
                    u_int32_t image_data_len;
                    if (MP4GetMetadataCoverArt (mp4File,
-                                               &image_data, &image_data_len))
+                                               &image_data, &image_data_len, 
0))
                    {
                        if (image_data)
                        {
@@ -452,7 +466,7 @@
            MP4GetMetadataAlbum (mp4File, &m_album);
            MP4GetMetadataGenre (mp4File, &m_genre);*/
            MP4GetMetadataTool (mp4File, &m_tool);
-           MP4GetMetadataCoverArt (mp4File, &m_covert, &m_size);
+           MP4GetMetadataCoverArt (mp4File, &m_covert, &m_size, 0);
            MP4MetadataDelete (mp4File);
 #endif
            value = charset_from_utf8 (track->title);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to