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

Justin Ruggles justin.ruggles
Sun Jan 23 20:58:00 CET 2011


On 01/22/2011 08:24 PM, Stefano Sabatini wrote:

Indeed if audiosyncmethod is >1 the resampler is used for audio drift compensation, and doaudioout() aborts for an assert failure because audioresample 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 @@ needrealloc: if (ost->resample) audioresampleclose(ost->resample); } - if (ost->resamplesamplefmt == enc->samplefmt && + if (audiosyncmethod <= 1 &&_ _+ ost->resamplesamplefmt == enc->samplefmt && ost->resamplechannels == enc->channels && ost->resamplesamplerate == enc->samplerate) { ost->resample = NULL;

looks ok, but maybe you should also add a comment.

-Justin



More information about the ffmpeg-devel mailing list