mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 01:28:34 +00:00
tsdemux: Need to flush all streams when we receive a flush-start
This commit is contained in:
parent
cb30cd242c
commit
59c61209cf
3 changed files with 28 additions and 3 deletions
|
@ -1154,6 +1154,18 @@ gst_mpegts_base_handle_eos (MpegTSBase * base)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
mpegts_base_flush (MpegTSBase * base)
|
||||||
|
{
|
||||||
|
MpegTSBaseClass *klass = GST_MPEGTS_BASE_GET_CLASS (base);
|
||||||
|
|
||||||
|
/* Call implementation */
|
||||||
|
if (G_UNLIKELY (klass->flush == NULL))
|
||||||
|
GST_WARNING_OBJECT (base, "Class doesn't have a 'flush' implementation !");
|
||||||
|
else
|
||||||
|
klass->flush (base);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
mpegts_base_sink_event (GstPad * pad, GstEvent * event)
|
mpegts_base_sink_event (GstPad * pad, GstEvent * event)
|
||||||
{
|
{
|
||||||
|
@ -1191,6 +1203,7 @@ mpegts_base_sink_event (GstPad * pad, GstEvent * event)
|
||||||
break;
|
break;
|
||||||
case GST_EVENT_FLUSH_START:
|
case GST_EVENT_FLUSH_START:
|
||||||
mpegts_packetizer_flush (base->packetizer);
|
mpegts_packetizer_flush (base->packetizer);
|
||||||
|
mpegts_base_flush (base);
|
||||||
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
|
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -162,6 +162,9 @@ struct _MpegTSBaseClass {
|
||||||
/* seek is called to wait for seeking */
|
/* seek is called to wait for seeking */
|
||||||
GstFlowReturn (*seek) (MpegTSBase * base, GstEvent * event, guint16 pid);
|
GstFlowReturn (*seek) (MpegTSBase * base, GstEvent * event, guint16 pid);
|
||||||
|
|
||||||
|
/* flush all streams */
|
||||||
|
void (*flush) (MpegTSBase * base);
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
void (*pat_info) (GstStructure *pat);
|
void (*pat_info) (GstStructure *pat);
|
||||||
void (*pmt_info) (GstStructure *pmt);
|
void (*pmt_info) (GstStructure *pmt);
|
||||||
|
|
|
@ -188,6 +188,7 @@ static void gst_ts_demux_reset (MpegTSBase * base);
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_ts_demux_push (MpegTSBase * base, MpegTSPacketizerPacket * packet,
|
gst_ts_demux_push (MpegTSBase * base, MpegTSPacketizerPacket * packet,
|
||||||
MpegTSPacketizerSection * section);
|
MpegTSPacketizerSection * section);
|
||||||
|
static void gst_ts_demux_flush (MpegTSBase * base);
|
||||||
static void
|
static void
|
||||||
gst_ts_demux_stream_added (MpegTSBase * base, MpegTSBaseStream * stream,
|
gst_ts_demux_stream_added (MpegTSBase * base, MpegTSBaseStream * stream,
|
||||||
MpegTSBaseProgram * program);
|
MpegTSBaseProgram * program);
|
||||||
|
@ -282,6 +283,7 @@ gst_ts_demux_class_init (GstTSDemuxClass * klass)
|
||||||
ts_class->stream_removed = gst_ts_demux_stream_removed;
|
ts_class->stream_removed = gst_ts_demux_stream_removed;
|
||||||
ts_class->find_timestamps = GST_DEBUG_FUNCPTR (find_timestamps);
|
ts_class->find_timestamps = GST_DEBUG_FUNCPTR (find_timestamps);
|
||||||
ts_class->seek = GST_DEBUG_FUNCPTR (gst_ts_demux_do_seek);
|
ts_class->seek = GST_DEBUG_FUNCPTR (gst_ts_demux_do_seek);
|
||||||
|
ts_class->flush = GST_DEBUG_FUNCPTR (gst_ts_demux_flush);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -882,9 +884,7 @@ gst_ts_demux_srcpad_event (GstPad * pad, GstEvent * event)
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK:
|
case GST_EVENT_SEEK:
|
||||||
res = mpegts_base_handle_seek_event ((MpegTSBase *) demux, pad, event);
|
res = mpegts_base_handle_seek_event ((MpegTSBase *) demux, pad, event);
|
||||||
if (res)
|
if (!res)
|
||||||
demux->need_newsegment = TRUE;
|
|
||||||
else
|
|
||||||
GST_WARNING ("seeking failed");
|
GST_WARNING ("seeking failed");
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
break;
|
break;
|
||||||
|
@ -2278,6 +2278,15 @@ gst_ts_demux_handle_packet (GstTSDemux * demux, TSDemuxStream * stream,
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_ts_demux_flush (MpegTSBase * base)
|
||||||
|
{
|
||||||
|
GstTSDemux *demux = GST_TS_DEMUX_CAST (base);
|
||||||
|
|
||||||
|
demux->need_newsegment = TRUE;
|
||||||
|
gst_ts_demux_flush_streams (demux);
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_ts_demux_push (MpegTSBase * base, MpegTSPacketizerPacket * packet,
|
gst_ts_demux_push (MpegTSBase * base, MpegTSPacketizerPacket * packet,
|
||||||
MpegTSPacketizerSection * section)
|
MpegTSPacketizerSection * section)
|
||||||
|
|
Loading…
Reference in a new issue