[FFmpeg-devel] [PATCH] Reset audio_resample to 0 only if audio_sync_method is <= 1.

Stefano Sabatini stefano.sabatini-lala
Sun Jan 23 02:24:58 CET 2011


Indeed if audio_sync_method is >1 the resampler is used for audio
drift compensation, and do_audio_out() aborts for an assert failure
because audio_resample is not set.

Fix issue 2516, which was introduced by SVN r25939.
---
 ffmpeg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 7cce343..1b7d79f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -825,7 +825,8 @@ need_realloc:
             if (ost->resample)
                 audio_resample_close(ost->resample);
         }
-        if (ost->resample_sample_fmt  == enc->sample_fmt &&
+        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;
-- 
1.7.2.3




More information about the ffmpeg-devel mailing list