uridecodebin: Only add a queue2 for buffering for non-adaptive streaming streams
This commit is contained in:
parent
89c9e23bfe
commit
a2837a22a5
@ -1877,7 +1877,7 @@ static void
|
|||||||
type_found (GstElement * typefind, guint probability,
|
type_found (GstElement * typefind, guint probability,
|
||||||
GstCaps * caps, GstURIDecodeBin * decoder)
|
GstCaps * caps, GstURIDecodeBin * decoder)
|
||||||
{
|
{
|
||||||
GstElement *dec_elem, *queue;
|
GstElement *src_elem, *dec_elem, *queue = NULL;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
const gchar *media_type;
|
const gchar *media_type;
|
||||||
gboolean do_download = FALSE;
|
gboolean do_download = FALSE;
|
||||||
@ -1901,6 +1901,9 @@ type_found (GstElement * typefind, guint probability,
|
|||||||
if (!dec_elem)
|
if (!dec_elem)
|
||||||
goto no_decodebin;
|
goto no_decodebin;
|
||||||
|
|
||||||
|
if (decoder->is_adaptive) {
|
||||||
|
src_elem = typefind;
|
||||||
|
} else {
|
||||||
queue = gst_element_factory_make ("queue2", NULL);
|
queue = gst_element_factory_make ("queue2", NULL);
|
||||||
if (!queue)
|
if (!queue)
|
||||||
goto no_queue2;
|
goto no_queue2;
|
||||||
@ -1950,18 +1953,21 @@ type_found (GstElement * typefind, guint probability,
|
|||||||
|
|
||||||
if (!gst_element_link_pads (typefind, "src", queue, "sink"))
|
if (!gst_element_link_pads (typefind, "src", queue, "sink"))
|
||||||
goto could_not_link;
|
goto could_not_link;
|
||||||
|
src_elem = queue;
|
||||||
|
}
|
||||||
|
|
||||||
/* to force caps on the decodebin element and avoid reparsing stuff by
|
/* 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
|
* typefind. It also avoids a deadlock in the way typefind activates pads in
|
||||||
* the state change */
|
* the state change */
|
||||||
g_object_set (dec_elem, "sink-caps", caps, NULL);
|
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;
|
goto could_not_link;
|
||||||
|
|
||||||
/* PLAYING in one go might fail (see bug #632782) */
|
/* 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_PAUSED);
|
||||||
gst_element_set_state (dec_elem, GST_STATE_PLAYING);
|
gst_element_set_state (dec_elem, GST_STATE_PLAYING);
|
||||||
|
if (queue)
|
||||||
gst_element_set_state (queue, GST_STATE_PLAYING);
|
gst_element_set_state (queue, GST_STATE_PLAYING);
|
||||||
|
|
||||||
do_async_done (decoder);
|
do_async_done (decoder);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user