oggdemux: Make sure that events are writable before changing their seqnum

This commit is contained in:
Sebastian Dröge 2018-06-18 13:28:15 +03:00
parent af3f307277
commit 3dd95b1311

View file

@ -2404,15 +2404,19 @@ gst_ogg_demux_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START: case GST_EVENT_FLUSH_START:
if (ogg->seqnum != GST_SEQNUM_INVALID) if (ogg->seqnum != GST_SEQNUM_INVALID) {
event = gst_event_make_writable (event);
gst_event_set_seqnum (event, ogg->seqnum); gst_event_set_seqnum (event, ogg->seqnum);
}
res = gst_ogg_demux_send_event (ogg, event); res = gst_ogg_demux_send_event (ogg, event);
break; break;
case GST_EVENT_FLUSH_STOP: case GST_EVENT_FLUSH_STOP:
GST_DEBUG_OBJECT (ogg, "got a flush stop event"); GST_DEBUG_OBJECT (ogg, "got a flush stop event");
ogg_sync_reset (&ogg->sync); ogg_sync_reset (&ogg->sync);
if (ogg->seqnum != GST_SEQNUM_INVALID) if (ogg->seqnum != GST_SEQNUM_INVALID) {
event = gst_event_make_writable (event);
gst_event_set_seqnum (event, ogg->seqnum); gst_event_set_seqnum (event, ogg->seqnum);
}
res = gst_ogg_demux_send_event (ogg, event); res = gst_ogg_demux_send_event (ogg, event);
if (ogg->pullmode || ogg->push_state != PUSH_DURATION) { if (ogg->pullmode || ogg->push_state != PUSH_DURATION) {
/* it's starting to feel reaaaally dirty :( /* it's starting to feel reaaaally dirty :(