summaryrefslogtreecommitdiff
path: root/gst/playback/gsturidecodebin.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/playback/gsturidecodebin.c')
-rw-r--r--gst/playback/gsturidecodebin.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c
index 391678d2a..1df1bb61e 100644
--- a/gst/playback/gsturidecodebin.c
+++ b/gst/playback/gsturidecodebin.c
@@ -1477,6 +1477,14 @@ type_found (GstElement * typefind, guint probability,
/* remember if we need download buffering */
decoder->is_download = IS_DOWNLOAD_MEDIA (media_type) && decoder->download;
+ /* only enable download buffering if the upstream duration is known */
+ if (decoder->is_download) {
+ GstFormat fmt = GST_FORMAT_BYTES;
+ gint64 dur;
+
+ decoder->is_download = (gst_element_query_duration (typefind, &fmt, &dur)
+ && fmt == GST_FORMAT_BYTES && dur != -1);
+ }
dec_elem = make_decoder (decoder);
if (!dec_elem)