[0.11] gst-plugins-base: audio: More UNPOSITION flag sanity checks

Sebastian Dröge slomo at kemper.freedesktop.org
Wed Jan 11 01:50:20 PST 2012


Module: gst-plugins-base
Branch: 0.11
Commit: de19cfdd8a2b5580e4ccb84ac2f80c5033abac88
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=de19cfdd8a2b5580e4ccb84ac2f80c5033abac88

Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date:   Wed Jan 11 10:49:49 2012 +0100

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 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gst-libs/gst/audio/audio.c b/gst-libs/gst/audio/audio.c
index 2075373..cdf39d4 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",



More information about the gstreamer-commits mailing list