oggdemux: set HEADER flag on header packets

https://bugzilla.gnome.org/show_bug.cgi?id=681499
This commit is contained in:
Tim-Philipp Müller 2012-08-11 10:18:37 +01:00
parent 8b15f5a8ab
commit 4ed7ebc071

View file

@ -478,6 +478,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
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; gboolean delta_unit = FALSE;
gboolean is_header;
cret = GST_FLOW_OK; cret = GST_FLOW_OK;
@ -545,7 +546,8 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
} }
/* get timing info for the packet */ /* get timing info for the packet */
if (gst_ogg_stream_packet_is_header (&pad->map, packet)) { is_header = gst_ogg_stream_packet_is_header (&pad->map, packet);
if (is_header) {
duration = 0; duration = 0;
GST_DEBUG_OBJECT (ogg, "packet is header"); GST_DEBUG_OBJECT (ogg, "packet is header");
} else { } else {
@ -640,6 +642,10 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
if (delta_unit) if (delta_unit)
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT); GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);
/* set header flag for buffers that are also in the streamheaders */
if (is_header)
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_HEADER);
if (packet->packet != NULL) { if (packet->packet != NULL) {
/* copy packet in buffer */ /* copy packet in buffer */
gst_buffer_fill (buf, 0, packet->packet + offset, gst_buffer_fill (buf, 0, packet->packet + offset,