From db4ccd86101e408bec622d7c7558b56876e9bb49 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 30 Apr 2010 13:36:59 +0200 Subject: [PATCH] playbin2: forward duration query duration during group switch if no cached duration ... such as during first group setup. Fixes #616396. --- gst/playback/gstplaybin2.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 3b34fcbfa6..44629b9a59 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -2072,11 +2072,15 @@ gst_play_bin_query (GstElement * element, GstQuery * query) break; } } - GST_DEBUG_OBJECT (playbin, - "Taking cached duration because of pending group switch: %d", ret); - GST_SOURCE_GROUP_UNLOCK (group); - GST_PLAY_BIN_UNLOCK (playbin); - return ret; + /* if nothing cached yet, we might as well request duration, + * such as during initial startup */ + if (ret) { + GST_DEBUG_OBJECT (playbin, + "Taking cached duration because of pending group switch: %d", ret); + GST_SOURCE_GROUP_UNLOCK (group); + GST_PLAY_BIN_UNLOCK (playbin); + return ret; + } } GST_SOURCE_GROUP_UNLOCK (group); }