summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2015-03-11 16:36:29 +0100
committerWim Taymans <wtaymans@redhat.com>2015-03-11 16:40:17 +0100
commit4b174b14f51b4d405674c0d1054e82f5dbc82094 (patch)
treebeeba290bf9c174dfa9290eadf5d2f49db49327b
parent8ce1f4d470d337d734d88daab2d31f40512c3f81 (diff)
basesink: clean up the need_preroll variable
Based on patch from Song Bing <b06498@freescale.com> Don't just set the need_preroll flag to TRUE in all cases. When we are already prerolled it needs to be set to FALSE and when we go to READY we should not touch it. We should only set it to TRUE in other cases, like what the code above does. See https://bugzilla.gnome.org/show_bug.cgi?id=736655
-rw-r--r--libs/gst/base/gstbasesink.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
index 8876d0423..748d2a256 100644
--- a/libs/gst/base/gstbasesink.c
+++ b/libs/gst/base/gstbasesink.c
@@ -5020,11 +5020,6 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
if (bclass->unlock_stop)
bclass->unlock_stop (basesink);
- /* we need preroll again and we set the flag before unlocking the clockid
- * because if the clockid is unlocked before a current buffer expired, we
- * can use that buffer to preroll with */
- basesink->need_preroll = TRUE;
-
if (basesink->clock_id) {
GST_DEBUG_OBJECT (basesink, "unschedule clock");
gst_clock_id_unschedule (basesink->clock_id);
@@ -5035,6 +5030,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
if (!gst_base_sink_needs_preroll (basesink)) {
GST_DEBUG_OBJECT (basesink, "PLAYING to PAUSED, we are prerolled");
basesink->playing_async = FALSE;
+ basesink->need_preroll = FALSE;
} else {
if (GST_STATE_TARGET (GST_ELEMENT (basesink)) <= GST_STATE_READY) {
GST_DEBUG_OBJECT (basesink, "element is <= READY");
@@ -5043,6 +5039,7 @@ gst_base_sink_change_state (GstElement * element, GstStateChange transition)
GST_DEBUG_OBJECT (basesink,
"PLAYING to PAUSED, we are not prerolled");
basesink->playing_async = TRUE;
+ basesink->need_preroll = TRUE;
priv->commited = FALSE;
priv->call_preroll = TRUE;
if (priv->async_enabled) {