gst-libs/gst/audio/gstaudiosink.c: Only actually wait for the thread to be stopped...
authorWim Taymans <wim.taymans@gmail.com>
Sat, 8 Oct 2005 12:02:08 +0000 (12:02 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Sat, 8 Oct 2005 12:02:08 +0000 (12:02 +0000)
Original commit message from CVS:
* gst-libs/gst/audio/gstaudiosink.c: (gst_audioringbuffer_stop):
Only actually wait for the thread to be stopped if it's
running.

ChangeLog
gst-libs/gst/audio/gstaudiosink.c

index 2be247893f9cb747830f8ed649771c78c62f287a..c32cfb1e6461d5e62ed68ffb0d6054cc6bb35b72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-10-08  Wim Taymans  <wim@fluendo.com>
+
+       * gst-libs/gst/audio/gstaudiosink.c: (gst_audioringbuffer_stop):
+       Only actually wait for the thread to be stopped if it's 
+       running.
+
 2005-10-08  Wim Taymans  <wim@fluendo.com>
 
        * gst-libs/gst/audio/gstbaseaudiosink.c:
index 5280691d9feacd055928ddd2231c376768df5e93..513c69cbbbcdb26e8c1979a4054bf3321073c76a 100644 (file)
@@ -381,9 +381,11 @@ gst_audioringbuffer_stop (GstRingBuffer * buf)
 {
   GstAudioSink *sink;
   GstAudioSinkClass *csink;
+  GstAudioRingBuffer *abuf;
 
   sink = GST_AUDIO_SINK (GST_OBJECT_PARENT (buf));
   csink = GST_AUDIO_SINK_GET_CLASS (sink);
+  abuf = GST_AUDIORING_BUFFER (buf);
 
   /* unblock any pending writes to the audio device */
   if (csink->reset) {
@@ -392,9 +394,11 @@ gst_audioringbuffer_stop (GstRingBuffer * buf)
     GST_DEBUG ("reset done");
   }
 
-  GST_DEBUG ("stop, waiting...");
-  GST_AUDIORING_BUFFER_WAIT (buf);
-  GST_DEBUG ("stopped");
+  if (abuf->running) {
+    GST_DEBUG ("stop, waiting...");
+    GST_AUDIORING_BUFFER_WAIT (buf);
+    GST_DEBUG ("stopped");
+  }
 
   return TRUE;
 }