commit dc3cc10a1351fd1bfc337b0ab5e2745fc05da344
Author: phantomjinx <p.g.richard...@phantomjinx.co.uk>
Date:   Tue Dec 27 18:37:02 2011 +0000

    m4a plugin incorrectly sets files to video.
    
    * m4afile.c
     * The mp4_get_file_info function already sets the media type so pointless
       to do it again here.
    
    * mp4file.c
     * Incorrectly sets m4a/m4b/m4p files to movie media type. Appropriately
       set media type based on file type.

 plugins/filetype_m4a/m4afile.c |   16 +---------------
 plugins/filetype_mp4/mp4file.c |   10 +++++++---
 2 files changed, 8 insertions(+), 18 deletions(-)
---
diff --git a/plugins/filetype_m4a/m4afile.c b/plugins/filetype_m4a/m4afile.c
index 418639b..a0d4df1 100644
--- a/plugins/filetype_m4a/m4afile.c
+++ b/plugins/filetype_m4a/m4afile.c
@@ -40,21 +40,7 @@
 /* Info on how to implement new file formats: see mp3file.c for more info */
 
 Track *m4a_get_file_info(const gchar *m4aFileName, GError **error) {
-    gchar *path_utf8;
-    gchar *suf;
-    Track *track = mp4_get_file_info(m4aFileName, error);
-    if (!track || error)
-        return track;
-
-    path_utf8 = charset_to_utf8(m4aFileName);
-    suf = strrchr(path_utf8, '.') + 1;
-    if (g_str_equal(suf, "m4b"))
-        track->mediatype = ITDB_MEDIATYPE_AUDIOBOOK;
-    else
-        track->mediatype = ITDB_MEDIATYPE_AUDIO;
-
-    g_free(path_utf8);
-    return track;
+    return mp4_get_file_info(m4aFileName, error);
 }
 
 gboolean m4a_write_file_info(const gchar *filename, Track *track, GError 
**error) {
diff --git a/plugins/filetype_mp4/mp4file.c b/plugins/filetype_mp4/mp4file.c
index b18a513..06c83d6 100644
--- a/plugins/filetype_mp4/mp4file.c
+++ b/plugins/filetype_mp4/mp4file.c
@@ -690,21 +690,25 @@ Track *mp4_get_file_info(const gchar *mp4FileName, GError 
**error) {
                 guint32 samplerate = MP4GetTrackTimeScale(mp4File, trackId);
 
                 track = gp_track_new();
-                track->mediatype = ITDB_MEDIATYPE_MOVIE;
-                track->movie_flag = 0x01;
                 track->tracklen = msDuration;
                 track->bitrate = avgBitRate / 1000;
                 track->samplerate = samplerate;
                 value = strrchr(mp4FileName, '.');
                 if (value) {
                     if (g_ascii_strcasecmp(value, ".m4a") == 0)
+                        track->mediatype = ITDB_MEDIATYPE_AUDIO;
                         track->filetype = g_strdup(_("AAC audio file"));
                     if (g_ascii_strcasecmp(value, ".m4p") == 0)
+                        track->mediatype = ITDB_MEDIATYPE_AUDIO;
                         track->filetype = g_strdup(_("Protected AAC audio 
file"));
                     if (g_ascii_strcasecmp(value, ".m4b") == 0)
+                        track->mediatype = ITDB_MEDIATYPE_AUDIOBOOK;
                         track->filetype = g_strdup(_("AAC audio book file"));
-                    if (g_ascii_strcasecmp(value, ".mp4") == 0)
+                    if (g_ascii_strcasecmp(value, ".mp4") == 0) {
+                        track->mediatype = ITDB_MEDIATYPE_MOVIE;
+                        track->movie_flag = 0x01;
                         track->filetype = g_strdup(_("MP4 video file"));
+                    }
                 }
                 if (prefs_get_int("readtags")) {
                     if (MP4GetMetadataName(mp4File, &value) && value != NULL) {

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to