oggdemux: Don't push new packets if there is a pending seek

There was a race condition where the demuxer would seek back to beginning after
determining the duration and while that seek was in progress one pad would
attempt to push a new buffer downstream, leading to a critical warning in
gst_pad_push().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8785>
This commit is contained in:
Philippe Normand 2025-04-07 15:07:56 +01:00
parent db17f54253
commit c4bfa73391

View File

@ -1288,9 +1288,19 @@ gst_ogg_pad_stream_out (GstOggPad * pad, gint npackets)
GstFlowReturn result = GST_FLOW_OK;
gboolean done = FALSE;
GstOggDemux *ogg;
gboolean drop;
ogg = pad->ogg;
GST_PUSH_LOCK (ogg);
drop = (ogg->seek_event_drop_till != GST_SEQNUM_INVALID);
GST_PUSH_UNLOCK (ogg);
if (drop) {
GST_DEBUG_OBJECT (ogg,
"Not pushing new packets until the pending seek is over");
return result;
}
while (!done) {
int ret;
ogg_packet packet;