summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2011-06-29 23:49:44 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2011-06-29 23:49:44 +0200
commit08b4a667ef0ed02980a74f3b2174de2040fe1061 (patch)
treeb748c3ae61ff636d801ab0e232ec667b84da076a /ffmpeg.c
parent4d08dfefa9911055fc89e94936bdbed7a6c4da36 (diff)
Set channel_layout if channels is set when transcoding.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index f2716a35aa..295d71044f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2282,8 +2282,10 @@ static int transcode(AVFormatContext **output_files,
}
choose_sample_rate(ost->st, ost->enc);
codec->time_base = (AVRational){1, codec->sample_rate};
- if (!codec->channels)
+ if (!codec->channels) {
codec->channels = icodec->channels;
+ codec->channel_layout = icodec->channel_layout;
+ }
if (av_get_channel_layout_nb_channels(codec->channel_layout) != codec->channels)
codec->channel_layout = 0;
ost->audio_resample = codec->sample_rate != icodec->sample_rate || audio_sync_method > 1;