From 5474600d4f43d1f17a6fad38968d369f3bddb9ac Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 25 May 2005 19:52:14 +0000 Subject: [PATCH] gst-libs/gst/audio/: Various small cleanups. Original commit message from CVS: * gst-libs/gst/audio/gstaudiosink.c: (gst_audioringbuffer_get_type), (gst_audioringbuffer_class_init), (audioringbuffer_thread_func), (gst_audioringbuffer_init), (gst_audioringbuffer_acquire), (gst_audioringbuffer_release), (gst_audioringbuffer_play), (gst_audioringbuffer_stop), (gst_audioringbuffer_delay), (gst_audiosink_class_init), (gst_audiosink_create_ringbuffer): * gst-libs/gst/audio/gstbaseaudiosink.c: (gst_baseaudiosink_class_init), (gst_baseaudiosink_init), (gst_baseaudiosink_get_clock), (gst_baseaudiosink_get_time), (gst_baseaudiosink_set_property), (build_linear_format), (debug_spec_caps), (debug_spec_buffer), (gst_baseaudiosink_setcaps), (gst_baseaudiosink_get_times), (gst_baseaudiosink_event), (gst_baseaudiosink_preroll), (gst_baseaudiosink_render), (gst_baseaudiosink_create_ringbuffer), (gst_baseaudiosink_callback), (gst_baseaudiosink_change_state): * gst-libs/gst/audio/gstringbuffer.c: (gst_ringbuffer_get_type), (gst_ringbuffer_set_callback), (gst_ringbuffer_acquire), (gst_ringbuffer_release), (gst_ringbuffer_is_acquired), (gst_ringbuffer_play), (gst_ringbuffer_pause), (gst_ringbuffer_stop), (gst_ringbuffer_delay), (gst_ringbuffer_played_samples), (gst_ringbuffer_set_sample), (wait_segment), (gst_ringbuffer_commit), (gst_ringbuffer_prepare_read), (gst_ringbuffer_advance), (gst_ringbuffer_clear): Various small cleanups. * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain), (gst_audio_convert_change_state): * gst/subparse/gstsubparse.c: (gst_subparse_chain): No need to take the locks anymore. --- ChangeLog | 34 ++++++++++++++++++++++++++++++++++ gst-libs/gst/audio/gstaudiosink.c | 1 + gst-libs/gst/audio/gstbaseaudiosink.c | 4 +++- gst/audioconvert/gstaudioconvert.c | 8 -------- gst/subparse/gstsubparse.c | 4 ---- 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e82a751..ea020a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,39 @@ 2005-05-25 Wim Taymans + * gst-libs/gst/audio/gstaudiosink.c: + (gst_audioringbuffer_get_type), (gst_audioringbuffer_class_init), + (audioringbuffer_thread_func), (gst_audioringbuffer_init), + (gst_audioringbuffer_acquire), (gst_audioringbuffer_release), + (gst_audioringbuffer_play), (gst_audioringbuffer_stop), + (gst_audioringbuffer_delay), (gst_audiosink_class_init), + (gst_audiosink_create_ringbuffer): + * gst-libs/gst/audio/gstbaseaudiosink.c: + (gst_baseaudiosink_class_init), (gst_baseaudiosink_init), + (gst_baseaudiosink_get_clock), (gst_baseaudiosink_get_time), + (gst_baseaudiosink_set_property), (build_linear_format), + (debug_spec_caps), (debug_spec_buffer), + (gst_baseaudiosink_setcaps), (gst_baseaudiosink_get_times), + (gst_baseaudiosink_event), (gst_baseaudiosink_preroll), + (gst_baseaudiosink_render), (gst_baseaudiosink_create_ringbuffer), + (gst_baseaudiosink_callback), (gst_baseaudiosink_change_state): + * gst-libs/gst/audio/gstringbuffer.c: (gst_ringbuffer_get_type), + (gst_ringbuffer_set_callback), (gst_ringbuffer_acquire), + (gst_ringbuffer_release), (gst_ringbuffer_is_acquired), + (gst_ringbuffer_play), (gst_ringbuffer_pause), + (gst_ringbuffer_stop), (gst_ringbuffer_delay), + (gst_ringbuffer_played_samples), (gst_ringbuffer_set_sample), + (wait_segment), (gst_ringbuffer_commit), + (gst_ringbuffer_prepare_read), (gst_ringbuffer_advance), + (gst_ringbuffer_clear): + Various small cleanups. + + * gst/audioconvert/gstaudioconvert.c: (gst_audio_convert_chain), + (gst_audio_convert_change_state): + * gst/subparse/gstsubparse.c: (gst_subparse_chain): + No need to take the locks anymore. + +2005-05-25 Wim Taymans + * gst/playback/gstdecodebin.c: (gst_decode_bin_init), (gst_decode_bin_dispose), (try_to_link_1), (get_our_ghost_pad), (remove_element_chain), (no_more_pads), (unlinked), (close_link), diff --git a/gst-libs/gst/audio/gstaudiosink.c b/gst-libs/gst/audio/gstaudiosink.c index b924bed..520d7bb 100644 --- a/gst-libs/gst/audio/gstaudiosink.c +++ b/gst-libs/gst/audio/gstaudiosink.c @@ -294,6 +294,7 @@ gst_audioringbuffer_release (GstRingBuffer * buf) /* free the buffer */ gst_buffer_unref (buf->data); + buf->data = NULL; if (csink->close) result = csink->close (sink); diff --git a/gst-libs/gst/audio/gstbaseaudiosink.c b/gst-libs/gst/audio/gstbaseaudiosink.c index 9af769a..8a2f52f 100644 --- a/gst-libs/gst/audio/gstbaseaudiosink.c +++ b/gst-libs/gst/audio/gstbaseaudiosink.c @@ -457,6 +457,7 @@ gst_baseaudiosink_event (GstBaseSink * bsink, GstEvent * event) sample = 0; have_value: + GST_DEBUG ("discont now at %lld", sample); gst_ringbuffer_set_sample (sink->ringbuffer, sample); break; } @@ -483,7 +484,8 @@ gst_baseaudiosink_render (GstBaseSink * bsink, GstBuffer * buf) offset = GST_BUFFER_OFFSET (buf); - GST_DEBUG ("in offset %llu, time %lld", offset, GST_BUFFER_TIMESTAMP (buf)); + GST_DEBUG ("in offset %llu, time %" GST_TIME_FORMAT, offset, + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); if (!gst_ringbuffer_is_acquired (sink->ringbuffer)) goto wrong_state; diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 4448c09..57b079e 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -244,8 +244,6 @@ gst_audio_convert_chain (GstPad * pad, GstBuffer * buf) * - convert rate and channels * - convert back to output format */ - GST_STREAM_LOCK (pad); - if (!GST_RPAD_CAPS (this->sink)) { goto not_negotiated; } else if (!GST_RPAD_CAPS (this->src)) { @@ -262,8 +260,6 @@ gst_audio_convert_chain (GstPad * pad, GstBuffer * buf) ret = gst_pad_push (this->src, buf); - GST_STREAM_UNLOCK (pad); - return ret; not_negotiated: @@ -271,7 +267,6 @@ not_negotiated: GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, (NULL), ("Pad not negotiated before chain function was called")); gst_buffer_unref (buf); - GST_STREAM_UNLOCK (pad); return GST_FLOW_NOT_NEGOTIATED; } no_format: @@ -279,7 +274,6 @@ no_format: GST_ELEMENT_ERROR (this, CORE, NEGOTIATION, (NULL), ("Could not negotiate format")); gst_buffer_unref (buf); - GST_STREAM_UNLOCK (pad); return GST_FLOW_ERROR; } } @@ -648,12 +642,10 @@ gst_audio_convert_change_state (GstElement * element) switch (transition) { case GST_STATE_PAUSED_TO_READY: - GST_STREAM_LOCK (this->sink); this->convert_internal = NULL; gst_audio_convert_unset_matrix (this); gst_caps_replace (&GST_RPAD_CAPS (this->sink), NULL); gst_caps_replace (&GST_RPAD_CAPS (this->src), NULL); - GST_STREAM_UNLOCK (this->sink); break; default: break; diff --git a/gst/subparse/gstsubparse.c b/gst/subparse/gstsubparse.c index 7c0ba7d..241166a 100644 --- a/gst/subparse/gstsubparse.c +++ b/gst/subparse/gstsubparse.c @@ -618,12 +618,8 @@ gst_subparse_chain (GstPad * sinkpad, GstBuffer * buf) GST_DEBUG ("gst_subparse_chain"); self = GST_SUBPARSE (GST_OBJECT_PARENT (sinkpad)); - GST_STREAM_LOCK (sinkpad); - ret = handle_buffer (self, buf); - GST_STREAM_UNLOCK (sinkpad); - return ret; } -- 2.7.4