[vlc-commits] avcodec: set default channel layout on encoding
Ilkka Ollakka
git at videolan.org
Sun Mar 24 13:18:18 CET 2013
vlc | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun Mar 24 11:39:15 2013 +0200| [13e4fe92b2d2557f4772098e8fdecd4c99e3ef0b] | committer: Ilkka Ollakka
avcodec: set default channel layout on encoding
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=13e4fe92b2d2557f4772098e8fdecd4c99e3ef0b
---
modules/codec/avcodec/encoder.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/modules/codec/avcodec/encoder.c b/modules/codec/avcodec/encoder.c
index 6d5de8b..54e34e4 100644
--- a/modules/codec/avcodec/encoder.c
+++ b/modules/codec/avcodec/encoder.c
@@ -46,6 +46,10 @@
#include "avcodec.h"
#include "avcommon.h"
+#if LIBAVUTIL_VERSION_CHECK( 52,2,6,0,0 )
+# include <libavutil/channel_layout.h>
+#endif
+
#define HURRY_UP_GUARD1 (450000)
#define HURRY_UP_GUARD2 (300000)
#define HURRY_UP_GUARD3 (100000)
@@ -635,6 +639,9 @@ int OpenEncoder( vlc_object_t *p_this )
p_context->time_base.num = 1;
p_context->time_base.den = p_context->sample_rate;
p_context->channels = p_enc->fmt_out.audio.i_channels;
+#if LIBAVUTIL_VERSION_CHECK( 52, 2, 6, 0, 0)
+ p_context->channel_layout = av_get_default_channel_layout( p_context->channels );
+#endif
if ( p_enc->fmt_out.i_codec == VLC_CODEC_MP4A )
{
More information about the vlc-commits
mailing list