summaryrefslogtreecommitdiff
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2010-08-27 18:45:19 (GMT)
committer Sebastian Dröge <sebastian.droege@collabora.co.uk>2010-08-27 18:45:19 (GMT)
commitc591b98864a25fcee865978142d8b79216aac76c (patch) (side-by-side diff)
tree747bde25bac77d24aa54c04c375fbc4acdee39ca
parentb899bca94d6fdd7cae2e0bdbdeffd3c6ca3e4f99 (diff)
downloadgst-plugins-base-c591b98864a25fcee865978142d8b79216aac76c.zip
gst-plugins-base-c591b98864a25fcee865978142d8b79216aac76c.tar.gz
uridecodebin: Only enable progressive downloading if the upstream duration in bytes is known
Otherwise we might try to enable it for live streams, where this would cause playback to fail completely. Fixes bug #628028.
Diffstat (more/less context) (ignore whitespace changes)
-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 391678d..1df1bb6 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)