mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-04 13:32:29 +00:00
gst-libs/gst/audio/gstringbuffer.c: Also allow the case where the ringbuffer was paused when we try to stop it so tha...
Original commit message from CVS: * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_start), (gst_ring_buffer_stop): Also allow the case where the ringbuffer was paused when we try to stop it so that the basesrc stop function is still called.
This commit is contained in:
parent
648d060427
commit
440432612b
2 changed files with 19 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-08-26 Wim Taymans <wim.taymans@collabora.co.uk>
|
||||||
|
|
||||||
|
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_start),
|
||||||
|
(gst_ring_buffer_stop):
|
||||||
|
Also allow the case where the ringbuffer was paused when we try to stop
|
||||||
|
it so that the basesrc stop function is still called.
|
||||||
|
|
||||||
2008-08-23 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
2008-08-23 Sebastian Dröge <sebastian.droege@collabora.co.uk>
|
||||||
|
|
||||||
Patch by: Mike Ruprecht <cmaiku at gmail dot com>
|
Patch by: Mike Ruprecht <cmaiku at gmail dot com>
|
||||||
|
|
|
@ -857,13 +857,14 @@ gst_ring_buffer_start (GstRingBuffer * buf)
|
||||||
GST_RING_BUFFER_STATE_STOPPED, GST_RING_BUFFER_STATE_STARTED);
|
GST_RING_BUFFER_STATE_STOPPED, GST_RING_BUFFER_STATE_STARTED);
|
||||||
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
|
GST_DEBUG_OBJECT (buf, "was not stopped, try paused");
|
||||||
/* was not stopped, try from paused */
|
/* was not stopped, try from paused */
|
||||||
res = g_atomic_int_compare_and_exchange (&buf->state,
|
res = g_atomic_int_compare_and_exchange (&buf->state,
|
||||||
GST_RING_BUFFER_STATE_PAUSED, GST_RING_BUFFER_STATE_STARTED);
|
GST_RING_BUFFER_STATE_PAUSED, GST_RING_BUFFER_STATE_STARTED);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
/* was not paused either, must be started then */
|
/* was not paused either, must be started then */
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
GST_DEBUG_OBJECT (buf, "was started");
|
GST_DEBUG_OBJECT (buf, "was not paused, must have been started");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
resume = TRUE;
|
resume = TRUE;
|
||||||
|
@ -1016,11 +1017,17 @@ gst_ring_buffer_stop (GstRingBuffer * buf)
|
||||||
GST_RING_BUFFER_STATE_STARTED, GST_RING_BUFFER_STATE_STOPPED);
|
GST_RING_BUFFER_STATE_STARTED, GST_RING_BUFFER_STATE_STOPPED);
|
||||||
|
|
||||||
if (!res) {
|
if (!res) {
|
||||||
/* was not started, must be stopped then */
|
GST_DEBUG_OBJECT (buf, "was not started, try paused");
|
||||||
GST_DEBUG_OBJECT (buf, "was not started");
|
/* was not started, try from paused */
|
||||||
|
res = g_atomic_int_compare_and_exchange (&buf->state,
|
||||||
|
GST_RING_BUFFER_STATE_PAUSED, GST_RING_BUFFER_STATE_STOPPED);
|
||||||
|
if (!res) {
|
||||||
|
/* was not paused either, must have been stopped then */
|
||||||
res = TRUE;
|
res = TRUE;
|
||||||
|
GST_DEBUG_OBJECT (buf, "was not paused, must have been stopped");
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* signal any waiters */
|
/* signal any waiters */
|
||||||
GST_DEBUG_OBJECT (buf, "signal waiter");
|
GST_DEBUG_OBJECT (buf, "signal waiter");
|
||||||
|
|
Loading…
Reference in a new issue