mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
mpegtsbase: flush in FLUSH_STOP to avoid race conditions
Ensure the chain is not running before reset the state to avoid race conditions and random corruptions downstream. Also fixes segfaults in the packetizer due wrong available values that causes gst_adapter_map to return a NULL pointer.
This commit is contained in:
parent
f17ebca62a
commit
cc40d49bed
1 changed files with 3 additions and 4 deletions
|
@ -1361,14 +1361,13 @@ mpegts_base_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
|
|||
/* FIXME, do something */
|
||||
gst_event_unref (event);
|
||||
break;
|
||||
case GST_EVENT_FLUSH_START:
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
|
||||
mpegts_packetizer_flush (base->packetizer);
|
||||
mpegts_base_flush (base);
|
||||
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
|
||||
break;
|
||||
case GST_EVENT_FLUSH_STOP:
|
||||
gst_segment_init (&base->segment, GST_FORMAT_UNDEFINED);
|
||||
base->seen_pat = FALSE;
|
||||
break;
|
||||
/* Passthrough */
|
||||
default:
|
||||
res = GST_MPEGTS_BASE_GET_CLASS (base)->push_event (base, event);
|
||||
|
|
Loading…
Reference in a new issue