[FFmpeg-cvslog] vsrc_buffer: release the buffer on uninit.

Anton Khirnov git at videolan.org
Fri Jan 13 01:41:21 CET 2012


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Dec 30 20:56:06 2011 +0100| [43fe6a29050fc34848731aa220292587f7ace5bd] | committer: Anton Khirnov

vsrc_buffer: release the buffer on uninit.

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

 libavfilter/vsrc_buffer.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/libavfilter/vsrc_buffer.c b/libavfilter/vsrc_buffer.c
index 178b3e6..e5b96a6 100644
--- a/libavfilter/vsrc_buffer.c
+++ b/libavfilter/vsrc_buffer.c
@@ -114,6 +114,14 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
     return 0;
 }
 
+static av_cold void uninit(AVFilterContext *ctx)
+{
+    BufferSourceContext *s = ctx->priv;
+    if (s->buf)
+        avfilter_unref_buffer(s->buf);
+    s->buf = NULL;
+}
+
 static int query_formats(AVFilterContext *ctx)
 {
     BufferSourceContext *c = ctx->priv;
@@ -167,6 +175,7 @@ AVFilter avfilter_vsrc_buffer = {
     .query_formats = query_formats,
 
     .init      = init,
+    .uninit    = uninit,
 
     .inputs    = (AVFilterPad[]) {{ .name = NULL }},
     .outputs   = (AVFilterPad[]) {{ .name            = "default",



More information about the ffmpeg-cvslog mailing list