From 443dc56b9f5f57967dc80342e751c8b231f51673 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Sat, 5 Nov 2005 19:41:23 +0000 Subject: 2005-11-05 Christophe Fergeau * src/itdb_track.c: (is_video_ipod), (itdb_track_set_defaults): deal with unk208 differently on iPod video (it's used to indicate if the current track must be shown in the video or audio menu or both) git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1141 f01d2545-417e-4e96-918e-98f8d0dbbcb6 --- src/itdb_track.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/itdb_track.c b/src/itdb_track.c index 1c02b41..d7ff6a4 100644 --- a/src/itdb_track.c +++ b/src/itdb_track.c @@ -33,6 +33,19 @@ #include #include +static gboolean is_video_ipod (IpodDevice *ipod) +{ + guint model; + + if (ipod == NULL) { + return FALSE; + } + g_object_get (G_OBJECT (ipod), "device-model", &model, NULL); + return ((model == MODEL_TYPE_VIDEO_WHITE) + || (model == MODEL_TYPE_VIDEO_BLACK)); +} + + /* Generate a new Itdb_Track structure */ Itdb_Track *itdb_track_new (void) { @@ -125,10 +138,12 @@ static void itdb_track_set_defaults (Itdb_Track *tr) tr->unk144 = 0x00; /* default value */ } } - /* The unk208 field seems to denote whether the file is a video or not. - It seems that it must be set to 0x00000002 for video files. */ - if (tr->unk208 == 0) - { + if (is_video_ipod (tr->itdb->device)) { + /* The unk208 field seems to denote whether the file is a video or not. + It seems that it must be set to 0x00000002 for video files. */ + /* Only doing that for iPod videos since it remains to be proven that + * setting unk208 to non-0 doesn't upset older ipod models + */ if (haystack (tr->filetype, m4v_desc)) { /* set type to video (0x00000002) */ @@ -136,7 +151,8 @@ static void itdb_track_set_defaults (Itdb_Track *tr) } else { - tr->unk208 = 0x00; /* default value */ + /* set type to audio */ + tr->unk208 = 0x00000001; } } /* The sample rate of the song expressed as an IEEE 32 bit -- cgit