gst-libs/gst/audio/multichannel.c: Give more useful warning messages if one of the channel layout enums passed to us ...

Original commit message from CVS:
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions), (add_list_to_struct):
Give more useful warning messages if one of the channel
layout enums passed to us is invalid and if the "channels"
field in the caps has a GType we don't expect.
This commit is contained in:
Tim-Philipp Müller 2008-02-19 20:36:58 +00:00
parent 29162d0a46
commit a1e59086ba
2 changed files with 11 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2008-02-19 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/audio/multichannel.c:
(gst_audio_check_channel_positions), (add_list_to_struct):
Give more useful warning messages if one of the channel
layout enums passed to us is invalid and if the "channels"
field in the caps has a GType we don't expect.
2008-02-19 Tim-Philipp Müller <tim at centricular dot net> 2008-02-19 Tim-Philipp Müller <tim at centricular dot net>
* gst-libs/gst/audio/multichannel.c: * gst-libs/gst/audio/multichannel.c:

View file

@ -71,7 +71,7 @@ gst_audio_check_channel_positions (const GstAudioChannelPosition * pos,
for (n = 0; n < channels; n++) { for (n = 0; n < channels; n++) {
if (pos[n] <= GST_AUDIO_CHANNEL_POSITION_INVALID || if (pos[n] <= GST_AUDIO_CHANNEL_POSITION_INVALID ||
pos[n] >= GST_AUDIO_CHANNEL_POSITION_NUM) { pos[n] >= GST_AUDIO_CHANNEL_POSITION_NUM) {
g_warning ("Channel position %d is invalid, not allowed", n); g_warning ("Channel position %d for channel %d is invalid", pos[n], n);
return FALSE; return FALSE;
} }
} }
@ -440,7 +440,8 @@ add_list_to_struct (GstStructure * str,
gst_caps_append_structure (caps, str); gst_caps_append_structure (caps, str);
} }
} else { } else {
g_warning ("Unknown value type for channels property"); g_warning ("Unexpected value type '%s' for channels property",
GST_STR_NULL (g_type_name (G_VALUE_TYPE (chan_val))));
} }
return caps; return caps;