mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +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/6410>
This commit is contained in:
parent
257de579b3
commit
9ce063f5f6
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,6 +323,7 @@ gst_adaptive_demux_loop_unlock_and_unpause (GstAdaptiveDemuxLoop * loop)
|
||||||
{
|
{
|
||||||
gboolean stopped;
|
gboolean stopped;
|
||||||
|
|
||||||
|
if (loop->context)
|
||||||
g_main_context_pop_thread_default (loop->context);
|
g_main_context_pop_thread_default (loop->context);
|
||||||
g_rec_mutex_unlock (&loop->context_lock);
|
g_rec_mutex_unlock (&loop->context_lock);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue