mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
uridecodebin: Only add a queue2 for buffering for non-adaptive streaming streams
This commit is contained in:
parent
89c9e23bfe
commit
a2837a22a5
1 changed files with 48 additions and 42 deletions
|
@ -1877,7 +1877,7 @@ static void
|
|||
type_found (GstElement * typefind, guint probability,
|
||||
GstCaps * caps, GstURIDecodeBin * decoder)
|
||||
{
|
||||
GstElement *dec_elem, *queue;
|
||||
GstElement *src_elem, *dec_elem, *queue = NULL;
|
||||
GstStructure *s;
|
||||
const gchar *media_type;
|
||||
gboolean do_download = FALSE;
|
||||
|
@ -1901,6 +1901,9 @@ type_found (GstElement * typefind, guint probability,
|
|||
if (!dec_elem)
|
||||
goto no_decodebin;
|
||||
|
||||
if (decoder->is_adaptive) {
|
||||
src_elem = typefind;
|
||||
} else {
|
||||
queue = gst_element_factory_make ("queue2", NULL);
|
||||
if (!queue)
|
||||
goto no_queue2;
|
||||
|
@ -1950,18 +1953,21 @@ type_found (GstElement * typefind, guint probability,
|
|||
|
||||
if (!gst_element_link_pads (typefind, "src", queue, "sink"))
|
||||
goto could_not_link;
|
||||
src_elem = queue;
|
||||
}
|
||||
|
||||
/* to force caps on the decodebin element and avoid reparsing stuff by
|
||||
* typefind. It also avoids a deadlock in the way typefind activates pads in
|
||||
* the state change */
|
||||
g_object_set (dec_elem, "sink-caps", caps, NULL);
|
||||
|
||||
if (!gst_element_link_pads (queue, "src", dec_elem, "sink"))
|
||||
if (!gst_element_link_pads (src_elem, "src", dec_elem, "sink"))
|
||||
goto could_not_link;
|
||||
|
||||
/* PLAYING in one go might fail (see bug #632782) */
|
||||
gst_element_set_state (dec_elem, GST_STATE_PAUSED);
|
||||
gst_element_set_state (dec_elem, GST_STATE_PLAYING);
|
||||
if (queue)
|
||||
gst_element_set_state (queue, GST_STATE_PLAYING);
|
||||
|
||||
do_async_done (decoder);
|
||||
|
|
Loading…
Reference in a new issue