Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-09-28 14:58:30 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-09-28 14:58:30 +0300
commitb880c13c3aa9e0d00509586224a0b30586ebb594 (patch)
tree3f63af5ab8fb50adc042df2971556cf96951eb5c /source/blender/blenkernel/intern/writeffmpeg.c
parenta33034cc3fd17802ffdd3e87e9958f5539f67bbb (diff)
parentb030277e791e429e8f8de90316144830eda6bbf8 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/blenkernel/intern/writeffmpeg.c')
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c
index 394f4cc1122..9cdb48998a0 100644
--- a/source/blender/blenkernel/intern/writeffmpeg.c
+++ b/source/blender/blenkernel/intern/writeffmpeg.c
@@ -725,6 +725,26 @@ static AVStream *alloc_audio_stream(FFMpegContext *context, RenderData *rd, int
c->sample_fmt = AV_SAMPLE_FMT_S16;
c->channels = rd->ffcodecdata.audio_channels;
+#ifdef FFMPEG_HAVE_FRAME_CHANNEL_LAYOUT
+ switch (rd->ffcodecdata.audio_channels) {
+ case FFM_CHANNELS_MONO:
+ c->channel_layout = AV_CH_LAYOUT_MONO;
+ break;
+ case FFM_CHANNELS_STEREO:
+ c->channel_layout = AV_CH_LAYOUT_STEREO;
+ break;
+ case FFM_CHANNELS_SURROUND4:
+ c->channel_layout = AV_CH_LAYOUT_QUAD;
+ break;
+ case FFM_CHANNELS_SURROUND51:
+ c->channel_layout = AV_CH_LAYOUT_5POINT1_BACK;
+ break;
+ case FFM_CHANNELS_SURROUND71:
+ c->channel_layout = AV_CH_LAYOUT_7POINT1;
+ break;
+ }
+#endif
+
if (request_float_audio_buffer(codec_id)) {
/* mainly for AAC codec which is experimental */
c->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;