oggdemux: Correctly set DELTA_UNIT flag for OGM streams

This commit is contained in:
Sebastian Dröge 2010-01-23 22:09:45 +01:00
parent b38dcf5277
commit a66ce94adc

View file

@ -483,6 +483,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
gint offset; gint offset;
GstClockTime out_timestamp, out_duration; GstClockTime out_timestamp, out_duration;
guint64 out_offset, out_offset_end; guint64 out_offset, out_offset_end;
gboolean delta_unit = FALSE;
GST_DEBUG_OBJECT (ogg, GST_DEBUG_OBJECT (ogg,
"%p streaming to peer serial %08x", pad, pad->map.serialno); "%p streaming to peer serial %08x", pad, pad->map.serialno);
@ -530,6 +531,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
} }
offset = 1 + (((data[0] & 0xc0) >> 6) | ((data[0] & 0x02) << 1)); offset = 1 + (((data[0] & 0xc0) >> 6) | ((data[0] & 0x02) << 1));
delta_unit = (((data[0] & 0x08) >> 3) == 0);
} else { } else {
offset = 0; offset = 0;
} }
@ -604,6 +606,10 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet)
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
goto no_buffer; goto no_buffer;
/* set delta flag for OGM content */
if (delta_unit)
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
/* copy packet in buffer */ /* copy packet in buffer */
memcpy (buf->data, packet->packet + offset, packet->bytes - offset); memcpy (buf->data, packet->packet + offset, packet->bytes - offset);