ffmpeg: fix -map_channel being ignored when resampling is not needed.
authorClément Bœsch <clement.boesch@smartjog.com>
Tue, 31 Jan 2012 14:51:01 +0000 (15:51 +0100)
committerClément Bœsch <ubitux@gmail.com>
Tue, 31 Jan 2012 16:44:46 +0000 (17:44 +0100)
ffmpeg.c

index 3c29f32..a794dd3 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1245,7 +1245,7 @@ need_realloc:
         ost->sync_opts = lrintf(get_sync_ipts(ost) * enc->sample_rate) -
                                 av_fifo_size(ost->fifo) / (enc->channels * osize); // FIXME wrong
 
-    if (ost->audio_resample) {
+    if (ost->audio_resample || ost->audio_channels_mapped) {
         buftmp = audio_buf;
         size_out = swr_convert(ost->swr, (      uint8_t*[]){buftmp}, audio_buf_size / (enc->channels * osize),
                                          (const uint8_t*[]){buf   }, size / (dec->channels * isize));