gst-libs/gst/audio/gstbaseaudiosink.c: Don't crash when ringbuffer is not yet created.

Original commit message from CVS:
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_setcaps):
Don't crash when ringbuffer is not yet created.
Patch by: Ville Syrjala <ville dot syrjala at movial dot fi>
Fixes #361634.
* gst/playback/gstplaybasebin.c: (new_decoded_pad_full):
* gst/playback/gststreamselector.c:
(gst_stream_selector_request_new_pad):
Activate pads befre adding them to running elements.
This commit is contained in:
Ville Syrjala 2006-10-13 14:15:42 +00:00 committed by Wim Taymans
parent 9e9538c658
commit 9b139e41fb
4 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,16 @@
2006-10-13 Wim Taymans <wim@fluendo.com>
* gst-libs/gst/audio/gstbaseaudiosink.c:
(gst_base_audio_sink_setcaps):
Don't crash when ringbuffer is not yet created.
Patch by: Ville Syrjala <ville dot syrjala at movial dot fi>
Fixes #361634.
* gst/playback/gstplaybasebin.c: (new_decoded_pad_full):
* gst/playback/gststreamselector.c:
(gst_stream_selector_request_new_pad):
Activate pads befre adding them to running elements.
2006-10-13 Julien MOUTTE <julien@moutte.net>
* tests/examples/seek/seek.c: (do_seek), (start_seek),

View file

@ -316,6 +316,9 @@ gst_base_audio_sink_setcaps (GstBaseSink * bsink, GstCaps * caps)
GstBaseAudioSink *sink = GST_BASE_AUDIO_SINK (bsink);
GstRingBufferSpec *spec;
if (!sink->ringbuffer)
return FALSE;
spec = &sink->ringbuffer->spec;
GST_DEBUG_OBJECT (sink, "release old ringbuffer");

View file

@ -1205,7 +1205,6 @@ new_decoded_pad_full (GstElement * element, GstPad * pad, gboolean last,
/* Store a pointer to the stream selector pad for this stream */
g_object_set_data (G_OBJECT (pad), "pb_sel_pad", sinkpad);
gst_pad_set_active (sinkpad, TRUE);
gst_pad_link (pad, sinkpad);
gst_object_unref (sinkpad);

View file

@ -354,11 +354,11 @@ gst_stream_selector_request_new_pad (GstElement * element,
GST_LOG_OBJECT (sel, "Creating new pad %d", sel->nb_sinkpads);
GST_OBJECT_LOCK (sel);
name = g_strdup_printf ("sink%d", sel->nb_sinkpads++);
sinkpad = gst_pad_new_from_template (templ, name);
g_free (name);
GST_OBJECT_LOCK (sel);
if (sel->active_sinkpad == NULL)
sel->active_sinkpad = gst_object_ref (sinkpad);
GST_OBJECT_UNLOCK (sel);
@ -372,6 +372,7 @@ gst_stream_selector_request_new_pad (GstElement * element,
gst_pad_set_bufferalloc_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_selector_bufferalloc));
gst_pad_set_active (sinkpad, TRUE);
gst_element_add_pad (GST_ELEMENT (sel), sinkpad);
return sinkpad;