gst-plugins-good: pulsesrc: fix wrong error check

Vincent Penquerc'h vincent at kemper.freedesktop.org
Fri Jan 13 10:14:00 PST 2012


Module: gst-plugins-good
Branch: master
Commit: f0ac29113cc88099b6cba0a0883cf17d451ca413
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=f0ac29113cc88099b6cba0a0883cf17d451ca413

Author: Vincent Penquerc'h <vincent.penquerch at collabora.co.uk>
Date:   Fri Jan 13 18:11:36 2012 +0000

pulsesrc: fix wrong error check

pa_stream_* functions return negative on error, despite the defines
for error codes being positive.

I only got to repro the error twice, so I'm not sure 100% sure this
fixes the issue (the negative var being uninitialized after returning
from pa_stream_get_latency).

---

 ext/pulse/pulsesrc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ext/pulse/pulsesrc.c b/ext/pulse/pulsesrc.c
index 88c8b00..98f7f0c 100644
--- a/ext/pulse/pulsesrc.c
+++ b/ext/pulse/pulsesrc.c
@@ -1230,7 +1230,7 @@ gst_pulsesrc_delay (GstAudioSrc * asrc)
 
   pa_threaded_mainloop_unlock (pulsesrc->mainloop);
 
-  if (res > 0) {
+  if (res < 0) {
     GST_DEBUG_OBJECT (pulsesrc, "could not get latency");
     result = 0;
   } else {



More information about the gstreamer-commits mailing list