summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-12-13 08:01:45 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-12-13 08:01:45 +0000
commit923580b14f0d40ccc3ca6118d5a044aa9a9f9848 (patch)
treeb4f1ef665d4069275fba4badb3f371491700d0cf
parent616c0eb07fb215eb9a2e6b910bde0d0353235053 (diff)
downloadgst-libav-923580b14f0d40ccc3ca6118d5a044aa9a9f9848.tar.gz
ext/ffmpeg/gstffmpegcodecmap.c: If no channel layout is provided don't set a NONE layout in the case of >2 channels b...
Original commit message from CVS: * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_channel_layout_to_gst): If no channel layout is provided don't set a NONE layout in the case of >2 channels but instead let audioconvert add some default layout.
-rw-r--r--ChangeLog7
-rw-r--r--ext/ffmpeg/gstffmpegcodecmap.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f503889..0bc2dcf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2008-12-13 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+ * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_channel_layout_to_gst):
+ If no channel layout is provided don't set a NONE layout in the
+ case of >2 channels but instead let audioconvert add some default
+ layout.
+
+2008-12-13 Sebastian Dröge <sebastian.droege@collabora.co.uk>
+
* ext/ffmpeg/Makefile.am:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ff_channel_layout_to_gst),
(gst_ff_aud_caps_new):
diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c
index ed2e01f..1d896df 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.c
+++ b/ext/ffmpeg/gstffmpegcodecmap.c
@@ -139,8 +139,9 @@ gst_ff_channel_layout_to_gst (guint64 channel_layout, guint channels)
none_layout = TRUE;
}
- if (!gst_audio_check_channel_positions (pos, nchannels)) {
- GST_ERROR ("Invalid channel layout - assuming NONE layout");
+ if (!none_layout && !gst_audio_check_channel_positions (pos, nchannels)) {
+ GST_ERROR ("Invalid channel layout %" G_GUINT64_FORMAT
+ " - assuming NONE layout", channel_layout);
none_layout = TRUE;
}
@@ -150,6 +151,9 @@ gst_ff_channel_layout_to_gst (guint64 channel_layout, guint channels)
} else if (nchannels == 2) {
pos[0] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
pos[1] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
+ } else if (channel_layout == 0) {
+ g_free (pos);
+ pos = NULL;
} else {
for (i = 0; i < nchannels; i++)
pos[i] = GST_AUDIO_CHANNEL_POSITION_NONE;