diff options
author | Christophe Fergeau <teuf@gnome.org> | 2005-11-05 19:41:23 +0000 |
---|---|---|
committer | Christophe Fergeau <teuf@gnome.org> | 2005-11-05 19:41:23 +0000 |
commit | e03c1390582e79e75fcfb8dd7312dc13b2c55bea (patch) | |
tree | e664d891985d50777268d80e7a25324627f7c3f5 /src/itdb_track.c | |
parent | f17f3b23735023fa68e5994964ddb80db6528a75 (diff) | |
download | libgpod-e03c1390582e79e75fcfb8dd7312dc13b2c55bea.tar.gz libgpod-e03c1390582e79e75fcfb8dd7312dc13b2c55bea.tar.xz libgpod-e03c1390582e79e75fcfb8dd7312dc13b2c55bea.zip |
2005-11-05 Christophe Fergeau <teuf@gnome.org>
* 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
Diffstat (limited to 'src/itdb_track.c')
-rw-r--r-- | src/itdb_track.c | 26 |
1 files changed, 21 insertions, 5 deletions
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 <string.h> #include <glib/gstdio.h> +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 |