audio: add debug output if channels mapping does not match
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 21 Mar 2016 11:26:50 +0000 (07:26 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Tue, 12 Apr 2016 18:48:30 +0000 (14:48 -0400)
https://bugzilla.gnome.org/show_bug.cgi?id=763985

gst-libs/gst/audio/gstaudioringbuffer.c

index 246c6f6..08bb38b 100644 (file)
@@ -1984,6 +1984,19 @@ gst_audio_ring_buffer_set_channel_positions (GstAudioRingBuffer * buf,
 
   for (i = 0; i < channels; i++) {
     if (buf->channel_reorder_map[i] != i) {
+#ifndef GST_DISABLE_GST_DEBUG
+      {
+        gchar *tmp1, *tmp2;
+
+        tmp1 = gst_audio_channel_positions_to_string (position, channels);
+        tmp2 = gst_audio_channel_positions_to_string (to, channels);
+        GST_LOG_OBJECT (buf, "may have to reorder channels: %s -> %s", tmp1,
+            tmp2);
+        g_free (tmp1);
+        g_free (tmp2);
+      }
+#endif /* GST_DISABLE_GST_DEBUG */
+
       buf->need_reorder = TRUE;
       break;
     }