From: Edward Hervey Date: Sat, 16 Aug 2008 14:54:56 +0000 (+0000) Subject: gst/avi/gstavidemux.c: Some AVI 2.0 (ODML) files don't respect the 'specifications... X-Git-Tag: 1.19.3~509^2~11039 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=25665a0df3ccad07a6867eb3d231d6e580393b99;p=platform%2Fupstream%2Fgstreamer.git gst/avi/gstavidemux.c: Some AVI 2.0 (ODML) files don't respect the 'specifications' completely and instead of using t... Original commit message from CVS: * gst/avi/gstavidemux.c: (gst_avi_demux_read_subindexes_pull), (gst_avi_demux_read_subindexes_push): Some AVI 2.0 (ODML) files don't respect the 'specifications' completely and instead of using the 'ix##' nomenclature, use '##ix'. They're still valid though, this fixes the duration and indexes for virtually all the ODML files I have. --- diff --git a/ChangeLog b/ChangeLog index 239a94d..a510629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-16 Edward Hervey + + * gst/avi/gstavidemux.c: (gst_avi_demux_read_subindexes_pull), + (gst_avi_demux_read_subindexes_push): + Some AVI 2.0 (ODML) files don't respect the 'specifications' completely + and instead of using the 'ix##' nomenclature, use '##ix'. + They're still valid though, this fixes the duration and indexes for + virtually all the ODML files I have. + 2008-08-15 Wim Taymans Patch by: Olivier Crete diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index eceff00..546f9bc 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -1120,8 +1120,10 @@ gst_avi_demux_read_subindexes_push (GstAviDemux * avi, for (i = 0; stream->indexes[i] != GST_BUFFER_OFFSET_NONE; i++) { if (!gst_avi_demux_peek_chunk (avi, &tag, &size)) continue; - else if (tag != GST_MAKE_FOURCC ('i', 'x', '0' + stream->num / 10, - '0' + stream->num % 10)) { + else if ((tag != GST_MAKE_FOURCC ('i', 'x', '0' + stream->num / 10, + '0' + stream->num % 10)) && + (tag != GST_MAKE_FOURCC ('0' + stream->num / 10, + '0' + stream->num % 10, 'i', 'x'))) { GST_WARNING_OBJECT (avi, "Not an ix## chunk (%" GST_FOURCC_FORMAT ")", GST_FOURCC_ARGS (tag)); continue; @@ -1171,8 +1173,12 @@ gst_avi_demux_read_subindexes_pull (GstAviDemux * avi, if (gst_riff_read_chunk (GST_ELEMENT (avi), avi->sinkpad, &stream->indexes[i], &tag, &buf) != GST_FLOW_OK) continue; - else if (tag != GST_MAKE_FOURCC ('i', 'x', '0' + stream->num / 10, - '0' + stream->num % 10)) { + else if ((tag != GST_MAKE_FOURCC ('i', 'x', '0' + stream->num / 10, + '0' + stream->num % 10)) && + (tag != GST_MAKE_FOURCC ('0' + stream->num / 10, + '0' + stream->num % 10, 'i', 'x'))) { + /* Some ODML files (created by god knows what muxer) have a ##ix format + * instead of the 'official' ix##. They are still valid though. */ GST_WARNING_OBJECT (avi, "Not an ix## chunk (%" GST_FOURCC_FORMAT ")", GST_FOURCC_ARGS (tag)); gst_buffer_unref (buf);