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
This commit is contained in:
Christoph Reiter 2018-05-22 22:58:22 +02:00 committed by Nirbheek Chauhan
parent adb1df3bc1
commit 2d98a5c1d7

View file

@ -43,7 +43,7 @@
/* Standard error path */ /* Standard error path */
#define HR_FAILED_AND(hr,func,and) \ #define HR_FAILED_AND(hr,func,and) \
do { \ do { \
if (hr != S_OK) { \ if (FAILED (hr)) { \
gchar *msg = gst_wasapi_util_hresult_to_string (hr); \ gchar *msg = gst_wasapi_util_hresult_to_string (hr); \
GST_ERROR_OBJECT (self, #func " failed (%x): %s", (guint) hr, msg); \ GST_ERROR_OBJECT (self, #func " failed (%x): %s", (guint) hr, msg); \
g_free (msg); \ g_free (msg); \