avidemux: push mode; cater for chunk padding

This commit is contained in:
Mark Nauwelaerts 2009-08-10 13:30:23 +02:00
parent f67db2a089
commit 96e72522fc

View file

@ -2971,6 +2971,10 @@ gst_avi_demux_stream_header_push (GstAviDemux * avi)
if (GST_READ_UINT32_LE (GST_BUFFER_DATA (buf)) != GST_RIFF_LIST_hdrl) if (GST_READ_UINT32_LE (GST_BUFFER_DATA (buf)) != GST_RIFF_LIST_hdrl)
goto header_no_hdrl; goto header_no_hdrl;
/* mind padding */
if (size & 1)
gst_adapter_flush (avi->adapter, 1);
GST_DEBUG ("'hdrl' LIST tag found. Parsing next chunk"); GST_DEBUG ("'hdrl' LIST tag found. Parsing next chunk");
/* the hdrl starts with a 'avih' header */ /* the hdrl starts with a 'avih' header */
@ -3078,6 +3082,9 @@ gst_avi_demux_stream_header_push (GstAviDemux * avi)
gst_adapter_flush (avi->adapter, 12); gst_adapter_flush (avi->adapter, 12);
if (size > 4) { if (size > 4) {
buf = gst_adapter_take_buffer (avi->adapter, size - 4); buf = gst_adapter_take_buffer (avi->adapter, size - 4);
/* mind padding */
if (size & 1)
gst_adapter_flush (avi->adapter, 1);
gst_riff_parse_info (GST_ELEMENT (avi), buf, gst_riff_parse_info (GST_ELEMENT (avi), buf,
&avi->globaltags); &avi->globaltags);
gst_buffer_unref (buf); gst_buffer_unref (buf);