From bc8f978a5ea10fc7a5adf10b97c3f824dc332034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergiusz=20=27q3k=27=20Baza=C5=84ski?= Date: Sat, 4 May 2013 13:10:22 +0200 Subject: [PATCH] Fix playvid desync due to losing some samples during resampling. I was limiting the decoder output to as many samples as were in the input - thus dropping ~10% of the samples at times. D'oh! --- tools/playvid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/playvid.c b/tools/playvid.c index b237832..17ada05 100644 --- a/tools/playvid.c +++ b/tools/playvid.c @@ -139,9 +139,8 @@ void moreaudio(float *lb, float *rb, int samples) } buffered_samples = avresample_convert(resampler, - (uint8_t **)resampleOutput, 0, pAudioFrame->nb_samples, + (uint8_t **)resampleOutput, 0, AUDIO_BUF, pAudioFrame->data, pAudioFrame->linesize[0], pAudioFrame->nb_samples); - pAudioBuffer = resampleOutput[0]; }