diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-01-19 18:37:31 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-01-20 11:47:04 +0100 |
commit | afc3c674c0380450301dfaa0124038fb492a443b (patch) | |
tree | b1a6b99cf10ea8c9d72ac548a9652040bcb1e74e | |
parent | 570319822a949b1798e306e9ec4ba6930631b658 (diff) |
avidemux: skip RIFF and index in push mode
When we are in push mode, we can encounter RIFF and idx tags in the data chunk
when we are dealing with ODML files. In these cases, simply skip the chunks and
continue streaming instead of going EOS.
-rw-r--r-- | gst/avi/gstavidemux.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 1dc5b11ca..4d8ccf8cc 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -4438,10 +4438,23 @@ gst_avi_demux_stream_data (GstAviDemux * avi) gst_adapter_flush (avi->adapter, 8 + GST_ROUND_UP_2 (size)); } return GST_FLOW_OK; + } else if (tag == GST_RIFF_TAG_RIFF) { + /* RIFF tags can appear in ODML files, just jump over them */ + if (gst_adapter_available (avi->adapter) >= 12) { + GST_DEBUG ("Found RIFF tag, skipping RIFF header"); + gst_adapter_flush (avi->adapter, 12); + continue; + } + return GST_FLOW_OK; } else if (tag == GST_RIFF_TAG_idx1) { - GST_DEBUG ("Found index tag, stream done"); - avi->have_eos = TRUE; - return GST_FLOW_UNEXPECTED; + GST_DEBUG ("Found index tag"); + if (gst_avi_demux_peek_chunk (avi, &tag, &size) || size == 0) { + /* accept 0 size buffer here */ + avi->abort_buffering = FALSE; + GST_DEBUG (" skipping %d bytes for now", size); + gst_adapter_flush (avi->adapter, 8 + GST_ROUND_UP_2 (size)); + } + return GST_FLOW_OK; } else if (tag == GST_RIFF_TAG_LIST) { /* movi chunks might be grouped in rec list */ if (gst_adapter_available (avi->adapter) >= 12) { |