]> git.sesse.net Git - ffmpeg/commitdiff
Do not set audio_resample to 0 if audio_sync_method is > 1.
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 23 Jan 2011 01:06:59 +0000 (02:06 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 26 Jan 2011 02:43:28 +0000 (03:43 +0100)
If audio_sync_method is >1 the resampler is used for audio drift
compensation, and do_audio_out() was causing an assert failure because
audio_resample was not set.

Fix issue 2516, which was introduced by SVN r25939.

Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit 07b48f8c7adaaf4020514816ec9b8d14cc8c5fbd)

ffmpeg.c

index 0b2bab2cec4e63cb0975d8fd16e1a95b382a1983..56b2dbed5ededee9eb746a2d6140532c36366aff 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -825,7 +825,9 @@ need_realloc:
             if (ost->resample)
                 audio_resample_close(ost->resample);
         }
-        if (ost->resample_sample_fmt  == enc->sample_fmt &&
+        /* if audio_sync_method is >1 the resampler is needed for audio drift compensation */
+        if (audio_sync_method <= 1 &&
+            ost->resample_sample_fmt  == enc->sample_fmt &&
             ost->resample_channels    == enc->channels   &&
             ost->resample_sample_rate == enc->sample_rate) {
             ost->resample = NULL;