ext/esd/esdsink.c: Don't return bogus values when esd_get_delay() fails for some...
authorTim-Philipp Müller <tim@centricular.net>
Thu, 4 Jan 2007 11:02:29 +0000 (11:02 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Thu, 4 Jan 2007 11:02:29 +0000 (11:02 +0000)
Original commit message from CVS:
* ext/esd/esdsink.c: (gst_esdsink_delay):
Don't return bogus values when esd_get_delay() fails for some
reason (#392189).

ChangeLog
ext/esd/esdsink.c

index def3d79..f9d8279 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-01-04  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * ext/esd/esdsink.c: (gst_esdsink_delay):
+         Don't return bogus values when esd_get_delay() fails for some
+         reason (#392189).
+
 2006-12-24  Tim-Philipp Müller  <tim at centricular dot net>
 
        * sys/ximage/gstximagesrc.c: (composite_pixel):
index 7fdfafc..3946b30 100644 (file)
@@ -424,6 +424,11 @@ gst_esdsink_delay (GstAudioSink * asink)
 
   latency = esd_get_latency (esdsink->ctrl_fd);
 
+  if (latency == (guint) - 1) {
+    GST_WARNING_OBJECT (asink, "couldn't get latency");
+    return 0;
+  }
+
   /* latency is measured in samples at a rate of 44100, this 
    * cannot overflow. */
   latency = latency * G_GINT64_CONSTANT (44100) / esdsink->rate;