1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

src_buffer: merge av_asrc_buffer_add_audio_buffer_ref.

Implement it using av_buffersrc_add_ref.
This commit is contained in:
Nicolas George
2012-04-28 00:16:20 +02:00
parent be8edff8d1
commit f8d58c594d

View File

@@ -570,27 +570,7 @@ int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *ctx,
AVFilterBufferRef *samplesref, AVFilterBufferRef *samplesref,
int av_unused flags) int av_unused flags)
{ {
BufferSourceContext *abuffer = ctx->priv; return av_buffersrc_add_ref(ctx, samplesref, AV_BUFFERSRC_FLAG_NO_COPY);
int ret;
if (av_fifo_space(abuffer->fifo) < sizeof(samplesref)) {
av_log(ctx, AV_LOG_ERROR,
"Buffering limit reached. Please consume some available frames "
"before adding new ones.\n");
return AVERROR(EINVAL);
}
ret = check_format_change(ctx, samplesref);
if (ret < 0)
return ret;
if (sizeof(samplesref) != av_fifo_generic_write(abuffer->fifo, &samplesref,
sizeof(samplesref), NULL)) {
av_log(ctx, AV_LOG_ERROR, "Error while writing to FIFO\n");
return AVERROR(EINVAL);
}
return 0;
} }
int av_asrc_buffer_add_samples(AVFilterContext *ctx, int av_asrc_buffer_add_samples(AVFilterContext *ctx,