From: Seungha Yang Date: Tue, 20 Sep 2022 15:26:38 +0000 (+0900) Subject: adaptivedemux2: Always wake up loop thread on unpause X-Git-Tag: 1.22.0~905 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9144f5313ce8a9af2735209db88bbd6bb096ee1;p=platform%2Fupstream%2Fgstreamer.git adaptivedemux2: Always wake up loop thread on unpause Otherwise loop thread will sleep forever because GstAdaptiveDemuxLoop.paused flag update is not signalled when loop was marked as stopped already from other thread. Part-of: --- diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemuxutils.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemuxutils.c index 925f93583a..b27e029248 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemuxutils.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemuxutils.c @@ -318,21 +318,23 @@ gst_adaptive_demux_loop_pause_and_lock (GstAdaptiveDemuxLoop * loop) gboolean gst_adaptive_demux_loop_unlock_and_unpause (GstAdaptiveDemuxLoop * loop) { + gboolean stopped; + g_main_context_pop_thread_default (loop->context); g_rec_mutex_unlock (&loop->context_lock); g_mutex_lock (&loop->lock); loop->paused = FALSE; - if (loop->stopped) { - g_mutex_unlock (&loop->lock); - return FALSE; - } + stopped = loop->stopped; - /* Wake up the loop to run again */ + /* Wake up the loop to run again, regardless of stopped state */ g_cond_broadcast (&loop->cond); g_mutex_unlock (&loop->lock); + if (stopped) + return FALSE; + return TRUE; }