audio: More UNPOSITION flag sanity checks

..and turn the GST_WARNING() into a g_warning(). This is a programming
error and should be fixed.
This commit is contained in:
Sebastian Dröge 2012-01-11 10:49:49 +01:00
parent a03f70e3cd
commit de19cfdd8a

View file

@ -676,7 +676,13 @@ gst_audio_info_to_caps (const GstAudioInfo * info)
if ((flags & GST_AUDIO_FLAG_UNPOSITIONED) && info->channels > 1 if ((flags & GST_AUDIO_FLAG_UNPOSITIONED) && info->channels > 1
&& info->position[0] != GST_AUDIO_CHANNEL_POSITION_NONE) { && info->position[0] != GST_AUDIO_CHANNEL_POSITION_NONE) {
flags &= ~GST_AUDIO_FLAG_UNPOSITIONED; flags &= ~GST_AUDIO_FLAG_UNPOSITIONED;
GST_WARNING ("Unpositioned flag set but channel positions present"); g_warning ("Unpositioned audio channel position flag set but "
"channel positions present");
} else if (!(flags & GST_AUDIO_FLAG_UNPOSITIONED) && info->channels > 1
&& info->position[0] == GST_AUDIO_CHANNEL_POSITION_NONE) {
flags |= GST_AUDIO_FLAG_UNPOSITIONED;
g_warning ("Unpositioned audio channel position flag not set "
"but no channel positions present");
} }
caps = gst_caps_new_simple ("audio/x-raw", caps = gst_caps_new_simple ("audio/x-raw",