[FFmpeg-devel] [PATCH 1/2] ffmpeg: move ost audio_resample heuristic to do_audio_out() scope.

Clément Bœsch ubitux at gmail.com
Tue Oct 18 10:17:58 CEST 2011


From: Clément Bœsch <clement.boesch at smartjog.com>

---
 ffmpeg.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index a8fc82f..45cc4b6 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -839,8 +839,11 @@ need_realloc:
         exit_program(1);
     }
 
-    if (enc->channels != dec->channels
-     || enc->sample_fmt != dec->sample_fmt)
+    if (enc->channels       != dec->channels       ||
+        enc->sample_fmt     != dec->sample_fmt     ||
+        enc->channel_layout != dec->channel_layout ||
+        enc->sample_rate    != dec->sample_rate    ||
+        audio_sync_method > 1)
         ost->audio_resample = 1;
 
     resample_changed = ost->resample_sample_fmt  != dec->sample_fmt ||
@@ -2169,9 +2172,6 @@ static int transcode_init(OutputFile *output_files, int nb_output_files,
                 }
                 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;
-                ost->audio_resample |=    codec->sample_fmt     != icodec->sample_fmt
-                                       || codec->channel_layout != icodec->channel_layout;
                 icodec->request_channels = codec->channels;
                 ost->resample_sample_fmt  = icodec->sample_fmt;
                 ost->resample_sample_rate = icodec->sample_rate;
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list