From 2c01338e917f2acb9043f03cdd40501ff4c1421b Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Tue, 22 May 2018 22:58:22 +0200 Subject: [PATCH] wasapi: use FAILED to detect errors S_FALSE is a valid return value which does not indicate an error. For example IAudioClient_Stop() returns S_FALSE when it is already stopped. Use the FAILED macro instead which just checks if an error occured or not. This fixes spurious warnings when using the wasapisink element. https://bugzilla.gnome.org/show_bug.cgi?id=796280 --- sys/wasapi/gstwasapiutil.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/wasapi/gstwasapiutil.h b/sys/wasapi/gstwasapiutil.h index d6049a3f5c..d525a92a79 100644 --- a/sys/wasapi/gstwasapiutil.h +++ b/sys/wasapi/gstwasapiutil.h @@ -43,7 +43,7 @@ /* Standard error path */ #define HR_FAILED_AND(hr,func,and) \ do { \ - if (hr != S_OK) { \ + if (FAILED (hr)) { \ gchar *msg = gst_wasapi_util_hresult_to_string (hr); \ GST_ERROR_OBJECT (self, #func " failed (%x): %s", (guint) hr, msg); \ g_free (msg); \