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 2be2478..c32cfb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 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:
        (gst_base_audio_sink_event), (gst_base_audio_sink_render):
        If we receive EOS we can start playback of what we had.
index 5280691..513c69c 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;
 }