mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
mpegtsdemux: Fix SEGMENT seqnum propagation
* If the seek was handled upstream, use that SEGMENT seqnum * Use the proper invalid default value
This commit is contained in:
parent
30644c4063
commit
e1133bbbfe
3 changed files with 10 additions and 3 deletions
|
@ -201,7 +201,7 @@ mpegts_base_reset (MpegTSBase * base)
|
|||
}
|
||||
|
||||
gst_segment_init (&base->segment, GST_FORMAT_UNDEFINED);
|
||||
base->last_seek_seqnum = (guint32) - 1;
|
||||
base->last_seek_seqnum = GST_SEQNUM_INVALID;
|
||||
|
||||
base->mode = BASE_MODE_STREAMING;
|
||||
base->seen_pat = FALSE;
|
||||
|
@ -1321,10 +1321,13 @@ mpegts_base_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
if (base->segment.format == GST_FORMAT_TIME) {
|
||||
base->packetizer->calculate_offset = FALSE;
|
||||
base->packetizer->calculate_skew = TRUE;
|
||||
/* Seek was handled upstream */
|
||||
base->last_seek_seqnum = gst_event_get_seqnum (event);
|
||||
} else {
|
||||
base->packetizer->calculate_offset = TRUE;
|
||||
base->packetizer->calculate_skew = FALSE;
|
||||
}
|
||||
|
||||
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
|
||||
break;
|
||||
case GST_EVENT_STREAM_START:
|
||||
|
@ -1583,6 +1586,10 @@ mpegts_base_loop (MpegTSBase * base)
|
|||
|
||||
GST_DEBUG ("Pulling data from %" G_GUINT64_FORMAT, base->seek_offset);
|
||||
|
||||
if (G_UNLIKELY (base->last_seek_seqnum == GST_SEQNUM_INVALID)) {
|
||||
/* No configured seek, set a valid seqnum */
|
||||
base->last_seek_seqnum = gst_util_seqnum_next ();
|
||||
}
|
||||
ret = gst_pad_pull_range (base->sinkpad, base->seek_offset,
|
||||
100 * base->packetsize, &buf);
|
||||
if (G_UNLIKELY (ret != GST_FLOW_OK))
|
||||
|
|
|
@ -148,7 +148,7 @@ struct _MpegTSBase {
|
|||
/* Upstream segment */
|
||||
GstSegment segment;
|
||||
|
||||
/* Last received seek event seqnum (default -1) */
|
||||
/* Last received seek event seqnum (default GST_SEQNUM_INVALID) */
|
||||
guint last_seek_seqnum;
|
||||
|
||||
/* Whether to parse private section or not */
|
||||
|
|
|
@ -2471,7 +2471,7 @@ calculate_and_push_newsegment (GstTSDemux * demux, TSDemuxStream * stream,
|
|||
|
||||
if (!demux->segment_event) {
|
||||
demux->segment_event = gst_event_new_segment (&demux->segment);
|
||||
GST_EVENT_SEQNUM (demux->segment_event) = base->last_seek_seqnum;
|
||||
gst_event_set_seqnum (demux->segment_event, base->last_seek_seqnum);
|
||||
}
|
||||
|
||||
push_new_segment:
|
||||
|
|
Loading…
Reference in a new issue