Commit b31d80d1 authored by Edward Hervey's avatar Edward Hervey 🤘 Committed by Edward Hervey

qtdemux: Store/Forward SEGMENT seqnum

And only reset it when doing *hard* resets
parent 6528a057
...@@ -2035,7 +2035,7 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard) ...@@ -2035,7 +2035,7 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
{ {
gint n; gint n;
GST_DEBUG_OBJECT (qtdemux, "Resetting demux"); GST_DEBUG_OBJECT (qtdemux, "Resetting demux (hard:%d)", hard);
gst_pad_stop_task (qtdemux->sinkpad); gst_pad_stop_task (qtdemux->sinkpad);
if (hard || qtdemux->upstream_format_is_time) { if (hard || qtdemux->upstream_format_is_time) {
...@@ -2101,9 +2101,9 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard) ...@@ -2101,9 +2101,9 @@ gst_qtdemux_reset (GstQTDemux * qtdemux, gboolean hard)
qtdemux->offset = 0; qtdemux->offset = 0;
gst_adapter_clear (qtdemux->adapter); gst_adapter_clear (qtdemux->adapter);
gst_segment_init (&qtdemux->segment, GST_FORMAT_TIME); gst_segment_init (&qtdemux->segment, GST_FORMAT_TIME);
qtdemux->segment_seqnum = GST_SEQNUM_INVALID;
if (hard) { if (hard) {
qtdemux->segment_seqnum = GST_SEQNUM_INVALID;
for (n = 0; n < qtdemux->n_streams; n++) { for (n = 0; n < qtdemux->n_streams; n++) {
gst_qtdemux_stream_free (qtdemux, qtdemux->streams[n]); gst_qtdemux_stream_free (qtdemux, qtdemux->streams[n]);
qtdemux->streams[n] = NULL; qtdemux->streams[n] = NULL;
...@@ -2209,6 +2209,7 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent, ...@@ -2209,6 +2209,7 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
GST_DEBUG_OBJECT (demux, "new pending_newsegment"); GST_DEBUG_OBJECT (demux, "new pending_newsegment");
gst_event_replace (&demux->pending_newsegment, event); gst_event_replace (&demux->pending_newsegment, event);
demux->upstream_format_is_time = TRUE; demux->upstream_format_is_time = TRUE;
demux->segment_seqnum = gst_event_get_seqnum (event);
} else { } else {
GST_DEBUG_OBJECT (demux, "Not storing upstream newsegment, " GST_DEBUG_OBJECT (demux, "Not storing upstream newsegment, "
"not in time format"); "not in time format");
...@@ -2287,7 +2288,8 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent, ...@@ -2287,7 +2288,8 @@ gst_qtdemux_handle_sink_event (GstPad * sinkpad, GstObject * parent,
GstEvent *segment_event = gst_event_new_segment (&segment); GstEvent *segment_event = gst_event_new_segment (&segment);
gst_event_replace (&demux->pending_newsegment, NULL); gst_event_replace (&demux->pending_newsegment, NULL);
gst_event_set_seqnum (segment_event, demux->segment_seqnum); if (demux->segment_seqnum != GST_SEQNUM_INVALID)
gst_event_set_seqnum (segment_event, demux->segment_seqnum);
gst_qtdemux_push_event (demux, segment_event); gst_qtdemux_push_event (demux, segment_event);
} else { } else {
gst_event_replace (&demux->pending_newsegment, NULL); gst_event_replace (&demux->pending_newsegment, NULL);
......
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