[Libav-user] one issue about audio resampler
applemax82 at 163.com
Fri Sep 18 05:33:23 CEST 2015
I'm using below functions to implement audio resampling, but encounter one issue.
swr_alloc_set_opts(), swr_init(), swr_convert_frame(), swr_get_delay().
Input frame is set to 8000hz mono AV_SAMPLE_FMT_FLT, while output frame is set to 44100Hz mono AV_SAMPLE_FMT_S16, and output frame's nb_samples is set to 80.
swr_get_delay() is used to check whether resampler can ouput one frame with 80 audio samples or not. If the return value from swr_get_delay() is less than 80, swr_convert_frame() will called next time when input audio samples are feed into resampler. Or swr_convert_frame() is used to flush resampler to output one audio frame with 80 samples.
But I encounter one issue. swr_get_delay().returns 88, which is larger than 80, and means audio resampler can be flushed to output one full audio frame with 80 samples. Resampler only outputs 41 samples, and next time output 0 samples, but swr_get_delay() always return 88. Why? is this a bug in ffmpeg?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user