gst-libs/gst/audio/gstbaseaudiosrc.c: Open and close device in READY<->NULL state change.

Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_change_state):
Open and close device in READY<->NULL state change.
This commit is contained in:
Wim Taymans 2005-08-16 15:53:59 +00:00
parent 107da3e93c
commit 4e3b19e5fb
2 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2005-08-16 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/audio/gstbaseaudiosrc.c:
(gst_base_audio_src_change_state):
Open and close device in READY<->NULL state change.
2005-08-16 Andy Wingo <wingo@pobox.com>
* examples/seeking/Makefile.am: Don't compile non-compiling

View file

@ -369,11 +369,15 @@ gst_base_audio_src_change_state (GstElement * element)
switch (transition) {
case GST_STATE_NULL_TO_READY:
if (src->ringbuffer == NULL) {
src->ringbuffer = gst_base_audio_src_create_ringbuffer (src);
gst_ring_buffer_set_callback (src->ringbuffer,
gst_base_audio_src_callback, src);
}
if (!gst_ring_buffer_open_device (src->ringbuffer))
return GST_STATE_FAILURE;
break;
case GST_STATE_READY_TO_PAUSED:
src->ringbuffer = gst_base_audio_src_create_ringbuffer (src);
gst_ring_buffer_set_callback (src->ringbuffer,
gst_base_audio_src_callback, src);
break;
case GST_STATE_PAUSED_TO_PLAYING:
break;
@ -390,10 +394,11 @@ gst_base_audio_src_change_state (GstElement * element)
case GST_STATE_PAUSED_TO_READY:
gst_ring_buffer_stop (src->ringbuffer);
gst_ring_buffer_release (src->ringbuffer);
gst_object_unref (GST_OBJECT (src->ringbuffer));
src->ringbuffer = NULL;
break;
case GST_STATE_READY_TO_NULL:
gst_ring_buffer_close_device (src->ringbuffer);
gst_object_unref (GST_OBJECT (src->ringbuffer));
src->ringbuffer = NULL;
break;
default:
break;