gst-libs/gst/audio/gstringbuffer.c: Don't try to call the delay method when the devic...
authorWim Taymans <wim.taymans@gmail.com>
Tue, 31 May 2005 11:38:10 +0000 (11:38 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Tue, 31 May 2005 11:38:10 +0000 (11:38 +0000)
Original commit message from CVS:
* gst-libs/gst/audio/gstringbuffer.c: (gst_ringbuffer_delay):
Don't try to call the delay method when the device is not
opened.

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

index 6218e43..9bcc87d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-05-31  Wim Taymans  <wim@fluendo.com>
 
+       * gst-libs/gst/audio/gstringbuffer.c: (gst_ringbuffer_delay):
+       Don't try to call the delay method when the device is not
+       opened.
+
+2005-05-31  Wim Taymans  <wim@fluendo.com>
+
        * ext/alsa/gstalsasink.c: (set_hwparams), (gst_alsasink_open):
        Get actual segment size and buffer size after opening
        the device.
index 9b13a20..36df08e 100644 (file)
@@ -431,6 +431,9 @@ gst_ringbuffer_delay (GstRingBuffer * buf)
 
   g_return_val_if_fail (buf != NULL, 0);
 
+  if (!gst_ringbuffer_is_acquired (buf))
+    return 0;
+
   rclass = GST_RINGBUFFER_GET_CLASS (buf);
   if (rclass->delay)
     res = rclass->delay (buf);