diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-01 11:08:08 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-11-27 16:49:19 -0500 |
commit | 1d86aa8b0f491f06e848026c7704daa39a54f523 (patch) | |
tree | d9c78bcce142f8b2d5845bb54721b8589a2e038f /libavresample/resample.c | |
parent | d2f9f8e094d9e699dfe31ee8006830946567484c (diff) | |
download | ffmpeg-1d86aa8b0f491f06e848026c7704daa39a54f523.tar.gz |
lavr: do not pass consumed samples as a parameter to ff_audio_resample()
Since the resampler handles buffering of unconsumed samples internally, the
caller does not need this information.
Diffstat (limited to 'libavresample/resample.c')
-rw-r--r-- | libavresample/resample.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libavresample/resample.c b/libavresample/resample.c index f0af1ffd58..381d673717 100644 --- a/libavresample/resample.c +++ b/libavresample/resample.c @@ -394,10 +394,9 @@ static int resample(ResampleContext *c, void *dst, const void *src, return dst_index; } -int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src, - int *consumed) +int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src) { - int ch, in_samples, in_leftover, out_samples = 0; + int ch, in_samples, in_leftover, consumed = 0, out_samples = 0; int ret = AVERROR(EINVAL); in_samples = src ? src->nb_samples : 0; @@ -430,7 +429,7 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src, /* resample each channel plane */ for (ch = 0; ch < c->buffer->channels; ch++) { out_samples = resample(c, (void *)dst->data[ch], - (const void *)c->buffer->data[ch], consumed, + (const void *)c->buffer->data[ch], &consumed, c->buffer->nb_samples, dst->allocated_samples, ch + 1 == c->buffer->channels); } @@ -440,7 +439,7 @@ int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src, } /* drain consumed samples from the internal buffer */ - ff_audio_data_drain(c->buffer, *consumed); + ff_audio_data_drain(c->buffer, consumed); av_dlog(c->avr, "resampled %d in + %d leftover to %d out + %d leftover\n", in_samples, in_leftover, out_samples, c->buffer->nb_samples); |