[FFmpeg-cvslog] src_buffer: merge av_asrc_buffer_add_audio_buffer_ref.

Nicolas George git at videolan.org
Thu May 3 19:57:53 CEST 2012


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Sat Apr 28 00:16:20 2012 +0200| [f8d58c594d23433fd59ba40b6f76091adbca9a88] | committer: Nicolas George

src_buffer: merge av_asrc_buffer_add_audio_buffer_ref.

Implement it using av_buffersrc_add_ref.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f8d58c594d23433fd59ba40b6f76091adbca9a88
---

 libavfilter/src_buffer.c |   22 +---------------------
 1 files changed, 1 insertions(+), 21 deletions(-)

diff --git a/libavfilter/src_buffer.c b/libavfilter/src_buffer.c
index 4c994c8..70af9c3 100644
--- a/libavfilter/src_buffer.c
+++ b/libavfilter/src_buffer.c
@@ -570,27 +570,7 @@ int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *ctx,
                                         AVFilterBufferRef *samplesref,
                                         int av_unused flags)
 {
-    BufferSourceContext *abuffer = ctx->priv;
-    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;
+    return av_buffersrc_add_ref(ctx, samplesref, AV_BUFFERSRC_FLAG_NO_COPY);
 }
 
 int av_asrc_buffer_add_samples(AVFilterContext *ctx,



More information about the ffmpeg-cvslog mailing list