mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-29 21:21:12 +00:00
adaptivedemux2: Handle context going away
This issue can happen when the scheduler loop was stopped (and context went away). We no longer want to push/pop main context threads. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6392>
This commit is contained in:
parent
8438c3f567
commit
46bb0bfa57
1 changed files with 5 additions and 1 deletions
|
@ -310,6 +310,9 @@ gst_adaptive_demux_loop_pause_and_lock (GstAdaptiveDemuxLoop * loop)
|
||||||
|
|
||||||
g_rec_mutex_lock (&loop->context_lock);
|
g_rec_mutex_lock (&loop->context_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!loop->context)
|
||||||
|
return FALSE;
|
||||||
g_main_context_push_thread_default (loop->context);
|
g_main_context_push_thread_default (loop->context);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -320,7 +323,8 @@ gst_adaptive_demux_loop_unlock_and_unpause (GstAdaptiveDemuxLoop * loop)
|
||||||
{
|
{
|
||||||
gboolean stopped;
|
gboolean stopped;
|
||||||
|
|
||||||
g_main_context_pop_thread_default (loop->context);
|
if (loop->context)
|
||||||
|
g_main_context_pop_thread_default (loop->context);
|
||||||
g_rec_mutex_unlock (&loop->context_lock);
|
g_rec_mutex_unlock (&loop->context_lock);
|
||||||
|
|
||||||
g_mutex_lock (&loop->lock);
|
g_mutex_lock (&loop->lock);
|
||||||
|
|
Loading…
Reference in a new issue