Commit a66ce94a authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

oggdemux: Correctly set DELTA_UNIT flag for OGM streams

parent b38dcf52
...@@ -483,6 +483,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet) ...@@ -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) ...@@ -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) ...@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment