From c469f9b2a4ed3d220af5980ac47ac1640184c8cc Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Sat, 21 Sep 2013 00:23:17 +0200 Subject: [PATCH] pad-monitor: Check if channel-mask is present only if channels > 2 As it is not a mandatory field otherwize https://bugzilla.gnome.org/show_bug.cgi?id=708499 --- validate/gst/validate/gst-validate-pad-monitor.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/validate/gst/validate/gst-validate-pad-monitor.c b/validate/gst/validate/gst-validate-pad-monitor.c index 0f9b6cc9ff..dbc61feeac 100644 --- a/validate/gst/validate/gst-validate-pad-monitor.c +++ b/validate/gst/validate/gst-validate-pad-monitor.c @@ -210,6 +210,7 @@ static void gst_validate_pad_monitor_check_raw_audio_caps_complete (GstValidatePadMonitor * monitor, GstStructure * structure) { + gint channels; _check_field_type (monitor, structure, "format", G_TYPE_STRING, GST_TYPE_LIST, 0); _check_field_type (monitor, structure, "layout", G_TYPE_STRING, GST_TYPE_LIST, @@ -218,8 +219,11 @@ gst_validate_pad_monitor_check_raw_audio_caps_complete (GstValidatePadMonitor * GST_TYPE_INT_RANGE, 0); _check_field_type (monitor, structure, "channels", G_TYPE_INT, GST_TYPE_LIST, GST_TYPE_INT_RANGE, 0); - _check_field_type (monitor, structure, "channel-mask", GST_TYPE_BITMASK, - GST_TYPE_LIST, 0); + if (gst_structure_get_int(structure, "channels", &channels)) { + if (channels > 2) + _check_field_type (monitor, structure, "channel-mask", GST_TYPE_BITMASK, + GST_TYPE_LIST, 0); + } } static void