From de19cfdd8a2b5580e4ccb84ac2f80c5033abac88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 11 Jan 2012 10:49:49 +0100 Subject: [PATCH] audio: More UNPOSITION flag sanity checks ..and turn the GST_WARNING() into a g_warning(). This is a programming error and should be fixed. --- gst-libs/gst/audio/audio.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/audio/audio.c b/gst-libs/gst/audio/audio.c index 2075373c82..cdf39d4f9a 100644 --- a/gst-libs/gst/audio/audio.c +++ b/gst-libs/gst/audio/audio.c @@ -676,7 +676,13 @@ gst_audio_info_to_caps (const GstAudioInfo * info) if ((flags & GST_AUDIO_FLAG_UNPOSITIONED) && info->channels > 1 && info->position[0] != GST_AUDIO_CHANNEL_POSITION_NONE) { 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",