From e03c1390582e79e75fcfb8dd7312dc13b2c55bea 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 --- ChangeLog | 6 ++++++ src/itdb_track.c | 26 +++++++++++++++++++++----- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 932b784..ea401f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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) + 2005-11-05 Christophe Fergeau * src/ipod-device.c: (ipod_device_get_property), 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