From 2255ffd384bbdfff1a3c00c49458e49fbec0e2e6 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Fri, 24 Jun 2005 16:15:25 +0000 Subject: [PATCH] gst-libs/gst/audio/gstaudiosink.c: Set the worker thread's running flag to TRUE before starting the thread. Original commit message from CVS: 2005-06-25 Jan Schmidt * gst-libs/gst/audio/gstaudiosink.c: (gst_audioringbuffer_acquire): Set the worker thread's running flag to TRUE before starting the thread. * gst/playback/gstdecodebin.c: (gst_decode_bin_init): Catch a failure to add typefind to the bin. --- ChangeLog | 7 +++++++ gst-libs/gst/audio/gstaudiosink.c | 4 ++++ gst/playback/gstdecodebin.c | 6 +++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 225f892..1de7ed3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-06-25 Jan Schmidt + * gst-libs/gst/audio/gstaudiosink.c: (gst_audioringbuffer_acquire): + Set the worker thread's running flag to TRUE before starting the + thread. + * gst/playback/gstdecodebin.c: (gst_decode_bin_init): + Catch a failure to add typefind to the bin. + 2005-06-24 Thomas Vander Stichele * gst/sine/gstsinesrc.c: (gst_sinesrc_class_init), diff --git a/gst-libs/gst/audio/gstaudiosink.c b/gst-libs/gst/audio/gstaudiosink.c index 520d7bb..410b46c 100644 --- a/gst-libs/gst/audio/gstaudiosink.c +++ b/gst-libs/gst/audio/gstaudiosink.c @@ -240,6 +240,7 @@ gst_audioringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec) { GstAudioSink *sink; GstAudioSinkClass *csink; + GstAudioRingBuffer *abuf; gboolean result = FALSE; sink = GST_AUDIOSINK (GST_OBJECT_PARENT (buf)); @@ -257,6 +258,9 @@ gst_audioringbuffer_acquire (GstRingBuffer * buf, GstRingBufferSpec * spec) buf->data = gst_buffer_new_and_alloc (spec->segtotal * spec->segsize); memset (GST_BUFFER_DATA (buf->data), 0, GST_BUFFER_SIZE (buf->data)); + abuf = GST_AUDIORINGBUFFER (buf); + abuf->running = TRUE; + sink->thread = g_thread_create ((GThreadFunc) audioringbuffer_thread_func, buf, TRUE, NULL); diff --git a/gst/playback/gstdecodebin.c b/gst/playback/gstdecodebin.c index fddfb4b..2340a9e 100644 --- a/gst/playback/gstdecodebin.c +++ b/gst/playback/gstdecodebin.c @@ -312,7 +312,11 @@ gst_decode_bin_init (GstDecodeBin * decode_bin) GstPad *pad; /* add the typefind element */ - gst_bin_add (GST_BIN (decode_bin), decode_bin->typefind); + if (!gst_bin_add (GST_BIN (decode_bin), decode_bin->typefind)) { + g_warning ("Could not add typefind element, decodebin will not work"); + gst_object_unref (GST_OBJECT (decode_bin->typefind)); + decode_bin->typefind = NULL; + } /* get the sinkpad */ pad = gst_element_get_pad (decode_bin->typefind, "sink"); -- 2.7.4