[FFmpeg-devel] [PATCH 2/2] opus_parser: replace ff_parse_close with opus_parse_close

Andreas Cadhalpun andreas.cadhalpun at googlemail.com
Fri Dec 9 01:09:14 EET 2016


The former expects priv_data to be the ParseContext directly, so using
it does not work.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
---
 libavcodec/opus_parser.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/libavcodec/opus_parser.c b/libavcodec/opus_parser.c
index 21a73ee..95f5725 100644
--- a/libavcodec/opus_parser.c
+++ b/libavcodec/opus_parser.c
@@ -180,9 +180,16 @@ static int opus_parse(AVCodecParserContext *ctx, AVCodecContext *avctx,
     return next;
 }
 
+static void opus_parse_close(AVCodecParserContext *ctx)
+{
+    OpusParseContext *s = ctx->priv_data;
+    ParseContext *pc    = &s->pc;
+    av_freep(&pc->buffer);
+}
+
 AVCodecParser ff_opus_parser = {
     .codec_ids      = { AV_CODEC_ID_OPUS },
     .priv_data_size = sizeof(OpusParseContext),
     .parser_parse   = opus_parse,
-    .parser_close   = ff_parse_close
+    .parser_close   = opus_parse_close
 };
-- 
2.10.2



More information about the ffmpeg-devel mailing list