mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
adaptivedemux2: Fix download helper with libsoup 3.0.x
libsoup 3.0.x dispatches using a single source attached when the session is created, so we need to create the session with the same context that our download thread is later using. 2.74 or 3.1 will dispatch a response using the context which sent the request. However, for any context other than the one that created the session, this will also create and destroy sources, so there's still some slight performance benefit. Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1384 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2913>
This commit is contained in:
parent
135edee484
commit
5ae3c9318d
1 changed files with 6 additions and 0 deletions
|
@ -609,10 +609,16 @@ downloadhelper_new (GstAdaptiveDemuxClock * clock)
|
|||
g_async_queue_new_full ((GDestroyNotify) g_object_unref);
|
||||
dh->transfer_requests_source = NULL;
|
||||
|
||||
/* libsoup 3.0 (not 2.74 or 3.1) dispatches using a single source attached
|
||||
* when the session is created, so we need to ensure it matches here. */
|
||||
g_main_context_push_thread_default (dh->transfer_context);
|
||||
|
||||
/* Set 10 second timeout. Any longer is likely
|
||||
* an attempt to reuse an already closed connection */
|
||||
dh->session = _soup_session_new_with_options ("timeout", 10, NULL);
|
||||
|
||||
g_main_context_pop_thread_default (dh->transfer_context);
|
||||
|
||||
return dh;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue