[0.10] gst-plugins-base: subtitleoverlay: fix state change stall on PAUSED- >READY->PAUSED

Tim Müller tpm at kemper.freedesktop.org
Mon Jan 23 09:15:09 PST 2012

Module: gst-plugins-base
Branch: 0.10
Commit: 2183d62048cdb303465fbc50fb08aa407c245b1a
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=2183d62048cdb303465fbc50fb08aa407c245b1a

Author: Anssi Hannula <anssi.hannula at iki.fi>
Date:   Tue Jan 17 16:05:41 2012 +0200

subtitleoverlay: fix state change stall on PAUSED->READY->PAUSED

After a PAUSED->READY change the sink pads are currently not set to
blocking state. When the element is set back to PAUSED, the change will
be done asynchronously, but as the _pad_blocked_cb() callback is now not
called, the state change never completes.

Fix that by setting the sink pads to blocking state on a PAUSED->READY
change, which ensures that the _pad_blocked_cb() is called when needed
on any future READY->PAUSED change. The sink pads are already put to
blocking state on NULL->READY change, so this behavior is consistent.

Fixes bug #668097.


 gst/playback/gstsubtitleoverlay.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/gst/playback/gstsubtitleoverlay.c b/gst/playback/gstsubtitleoverlay.c
index 061d049..a3e96c7 100644
--- a/gst/playback/gstsubtitleoverlay.c
+++ b/gst/playback/gstsubtitleoverlay.c
@@ -1503,6 +1503,15 @@ gst_subtitle_overlay_change_state (GstElement * element,
       GST_DEBUG_OBJECT (self, "State change PAUSED->READY");
+      /* Set the pads back to blocking state */
+      gst_pad_set_blocked_async_full (self->video_block_pad, TRUE,
+          _pad_blocked_cb, self, NULL);
+      gst_pad_set_blocked_async_full (self->subtitle_block_pad, TRUE,
+          _pad_blocked_cb, self, NULL);
       do_async_done (self);

More information about the gstreamer-commits mailing list