gstpad: Fix PROBE_NO_DATA macro

The problem was that the macro was always used with 'ret' as the defaultval
argument.

This would result in the macro eventually expanding to
    if (G_UNLIKELY (ret != ret && ret != GST_FLOW_OK))

... ret != ret will always fail, and therefore we'd never call the
following line.

Instead of that, store the previous value locally for comparision
This commit is contained in:
Edward Hervey 2015-01-21 11:45:41 +01:00
parent aeca7eb480
commit 93f540bb62

View file

@ -3215,10 +3215,11 @@ no_match:
#define PROBE_NO_DATA(pad,mask,label,defaultval) \
G_STMT_START { \
if (G_UNLIKELY (pad->num_probes)) { \
GstFlowReturn pval = defaultval; \
/* pass NULL as the data item */ \
GstPadProbeInfo info = { mask, 0, NULL, 0, 0 }; \
ret = do_probe_callbacks (pad, &info, defaultval); \
if (G_UNLIKELY (ret != defaultval && ret != GST_FLOW_OK)) \
if (G_UNLIKELY (ret != pval && ret != GST_FLOW_OK)) \
goto label; \
} \
} G_STMT_END