From: Jan Schmidt Date: Sun, 7 Aug 2016 14:56:38 +0000 (+1000) Subject: splitmux: Recheck state after unlocking mutex. X-Git-Tag: 1.19.3~509^2~2612 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=89af379ff040923cfcbaf05354ed2b01a620b1b9;p=platform%2Fupstream%2Fgstreamer.git splitmux: Recheck state after unlocking mutex. After dropping the splitmux lock, re-check the state, don't just fall through and sleep unconditionally, as we may have already missed the wakeup. https://bugzilla.gnome.org/show_bug.cgi?id=769514 --- diff --git a/gst/multifile/gstsplitmuxsink.c b/gst/multifile/gstsplitmuxsink.c index bf66a113f5..d3908c0e56 100644 --- a/gst/multifile/gstsplitmuxsink.c +++ b/gst/multifile/gstsplitmuxsink.c @@ -1233,6 +1233,9 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx) GST_SPLITMUX_UNLOCK (splitmux); gst_pad_send_event (ctx->sinkpad, event); GST_SPLITMUX_LOCK (splitmux); + /* state may have changed while we were unlocked. Loop again if so */ + if (splitmux->state != SPLITMUX_STATE_ENDING_FILE) + break; /* fallthrough */ } case SPLITMUX_STATE_START_NEXT_FRAGMENT: