Fix bug where streams with sample rate < 44100 stop too early (with libav 10+)

- avresample_convert should be passed max samples to convert, not
number of samples in input (which for low sample rates is lower
than output)
This commit is contained in:
ejurgensen 2014-07-06 23:31:20 +02:00
parent 129c00c3d1
commit 17ffdc56ad

View File

@ -285,7 +285,7 @@ transcode(struct transcode_ctx *ctx, struct evbuffer *evbuf, int wanted)
{
av_samples_get_buffer_size(&out_linesize, 2, frame->nb_samples, AV_SAMPLE_FMT_S16, 0);
out_samples = avresample_convert(ctx->resample_ctx, (uint8_t **)&ctx->re_abuffer, out_linesize, frame->nb_samples,
out_samples = avresample_convert(ctx->resample_ctx, (uint8_t **)&ctx->re_abuffer, out_linesize, XCODE_BUFFER_SIZE,
(uint8_t **)frame->data, frame->linesize[0], frame->nb_samples);
if (out_samples < 0)
{