diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2009-01-05 17:13:13 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2009-01-05 17:13:13 +0000 |
commit | 0a4c1bc64c7033cb65cfc3f597dab8d4620dcd26 (patch) | |
tree | ee26538b410b1c29f64bf6e278d6d46e87f6e3eb | |
parent | 8632fc5545ab5b7e35e1d4234dd18f1963de3d90 (diff) |
gst-libs/gst/audio/gstbaseaudiosink.c: Avoid holding the OBJECT_LOCK when calling ringbuffer functions that take the ...
Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_change_state):
Avoid holding the OBJECT_LOCK when calling ringbuffer functions that
take the ringbuffer lock because rinbuffer lock > OBJECT_LOCK. We can do
this because the async_play method is deprecated and usually not called
anymore.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | gst-libs/gst/audio/gstbaseaudiosink.c | 28 |
2 files changed, 21 insertions, 16 deletions
@@ -1,5 +1,14 @@ 2009-01-05 Wim Taymans <wim.taymans@collabora.co.uk> + * gst-libs/gst/audio/gstbaseaudiosink.c: + (gst_base_audio_sink_change_state): + Avoid holding the OBJECT_LOCK when calling ringbuffer functions that + take the ringbuffer lock because rinbuffer lock > OBJECT_LOCK. We can do + this because the async_play method is deprecated and usually not called + anymore. + +2009-01-05 Wim Taymans <wim.taymans@collabora.co.uk> + * gst/playback/gstplaybin2.c: (notify_source_cb), (activate_group): Disconnect signal handlers before destroying a previous decodebin so that we don't end up causing deadlocks. Fixes #566586. diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 7f42d7eb..59318ab5 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -1710,18 +1710,6 @@ gst_base_audio_sink_async_play (GstBaseSink * basesink) } static GstStateChangeReturn -gst_base_audio_sink_do_play (GstBaseAudioSink * sink) -{ - GstStateChangeReturn ret; - - GST_OBJECT_LOCK (sink); - ret = gst_base_audio_sink_async_play (GST_BASE_SINK_CAST (sink)); - GST_OBJECT_UNLOCK (sink); - - return ret; -} - -static GstStateChangeReturn gst_base_audio_sink_change_state (GstElement * element, GstStateChange transition) { @@ -1745,15 +1733,23 @@ gst_base_audio_sink_change_state (GstElement * element, gst_ring_buffer_may_start (sink->ringbuffer, FALSE); break; case GST_STATE_CHANGE_PAUSED_TO_PLAYING: - gst_base_audio_sink_do_play (sink); + GST_OBJECT_LOCK (sink); + GST_DEBUG_OBJECT (sink, "ringbuffer may start now"); + sink->priv->sync_latency = TRUE; + GST_OBJECT_UNLOCK (sink); + + gst_ring_buffer_may_start (sink->ringbuffer, TRUE); + if (GST_BASE_SINK_CAST (sink)->pad_mode == GST_ACTIVATE_PULL) { + /* we always start the ringbuffer in pull mode immediatly */ + gst_ring_buffer_start (sink->ringbuffer); + } break; case GST_STATE_CHANGE_PLAYING_TO_PAUSED: - /* need to take the lock so we don't interfere with an - * async play */ - GST_OBJECT_LOCK (sink); /* ringbuffer cannot start anymore */ gst_ring_buffer_may_start (sink->ringbuffer, FALSE); gst_ring_buffer_pause (sink->ringbuffer); + + GST_OBJECT_LOCK (sink); sink->priv->sync_latency = FALSE; GST_OBJECT_UNLOCK (sink); break; |