[Libav-user] Understanding a line in muxing.c
Hendrik Leppkes
h.leppkes at gmail.com
Fri May 16 18:41:08 CEST 2014
On Fri, May 16, 2014 at 6:39 PM, Gonzalo Garramuno <ggarra13 at gmail.com> wrote:
> I have trouble understanding what the following line in muxing.c does:
>
>
> /* compute destination number of samples */
> dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, c->sample_rate)
> + src_nb_samples, c->sample_rate, c->sample_rate, AV_ROUND_UP);
>
>
> I was always expecting that:
>
> dst_nb_samples = src_nb_samples;
>
> Can someone explain to me why the above is needed?
If you resample the audio, you'll change the number of samples, which
this lines handles.
If you don't need resampling, the number of samples should remain the same.
- Hendrik
More information about the Libav-user
mailing list