mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-29 20:35:40 +00:00
gst-libs/gst/audio/gstbaseaudiosink.c: Set ringbuffer to non-flushing when going to PAUSED, set to flushing again whe...
Original commit message from CVS: * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_base_audio_sink_provide_clock), (gst_base_audio_sink_change_state): Set ringbuffer to non-flushing when going to PAUSED, set to flushing again when going to READY. * gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_init), (gst_ring_buffer_stop): Start in flushing mode by default. Don't set flushing in the _stop method, let the app call this explicitly.
This commit is contained in:
parent
451645fd56
commit
99fb91493e
3 changed files with 26 additions and 3 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
2005-11-16 Wim Taymans <wim@fluendo.com>
|
||||
|
||||
* gst-libs/gst/audio/gstbaseaudiosink.c:
|
||||
(gst_base_audio_sink_provide_clock),
|
||||
(gst_base_audio_sink_change_state):
|
||||
Set ringbuffer to non-flushing when going to PAUSED, set to
|
||||
flushing again when going to READY.
|
||||
|
||||
* gst-libs/gst/audio/gstringbuffer.c: (gst_ring_buffer_init),
|
||||
(gst_ring_buffer_stop):
|
||||
Start in flushing mode by default.
|
||||
Don't set flushing in the _stop method, let the app call
|
||||
this explicitly.
|
||||
|
||||
2005-11-16 Julien MOUTTE <julien@moutte.net>
|
||||
|
||||
* gst-libs/gst/video/gstvideosink.c: (gst_video_sink_center_rect):
|
||||
|
|
|
@ -162,10 +162,17 @@ static GstClock *
|
|||
gst_base_audio_sink_provide_clock (GstElement * elem)
|
||||
{
|
||||
GstBaseAudioSink *sink;
|
||||
GstClock *clock;
|
||||
|
||||
sink = GST_BASE_AUDIO_SINK (elem);
|
||||
|
||||
return GST_CLOCK (gst_object_ref (sink->clock));
|
||||
#if 1
|
||||
clock = GST_CLOCK_CAST (gst_object_ref (sink->clock));
|
||||
#else
|
||||
clock = gst_system_clock_obtain ();
|
||||
#endif
|
||||
|
||||
return clock;
|
||||
}
|
||||
|
||||
static GstClockTime
|
||||
|
@ -534,6 +541,7 @@ gst_base_audio_sink_change_state (GstElement * element,
|
|||
sink->next_sample = 0;
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
||||
gst_ring_buffer_set_flushing (sink->ringbuffer, FALSE);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
||||
break;
|
||||
|
@ -548,9 +556,10 @@ gst_base_audio_sink_change_state (GstElement * element,
|
|||
gst_ring_buffer_pause (sink->ringbuffer);
|
||||
break;
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
gst_ring_buffer_set_flushing (sink->ringbuffer, TRUE);
|
||||
gst_ring_buffer_stop (sink->ringbuffer);
|
||||
gst_pad_set_caps (GST_BASE_SINK_PAD (sink), NULL);
|
||||
gst_ring_buffer_release (sink->ringbuffer);
|
||||
gst_pad_set_caps (GST_BASE_SINK_PAD (sink), NULL);
|
||||
break;
|
||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||
gst_ring_buffer_close_device (sink->ringbuffer);
|
||||
|
|
|
@ -88,6 +88,7 @@ gst_ring_buffer_init (GstRingBuffer * ringbuffer)
|
|||
ringbuffer->cond = g_cond_new ();
|
||||
ringbuffer->waiting = 0;
|
||||
ringbuffer->empty_seg = NULL;
|
||||
ringbuffer->flushing = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -796,7 +797,6 @@ gst_ring_buffer_stop (GstRingBuffer * buf)
|
|||
GST_DEBUG_OBJECT (buf, "stopping");
|
||||
|
||||
GST_LOCK (buf);
|
||||
buf->flushing = TRUE;
|
||||
|
||||
/* if started, set to stopped */
|
||||
res = g_atomic_int_compare_and_exchange (&buf->state,
|
||||
|
|
Loading…
Reference in a new issue