On Wed, 29 Feb 2012, Justin Ruggles wrote:

---
libavcodec/libvo-aacenc.c |  121 +++++++++++++++++++++++++++++++++++---------
1 files changed, 96 insertions(+), 25 deletions(-)

diff --git a/libavcodec/libvo-aacenc.c b/libavcodec/libvo-aacenc.c
index 0a4a270..f29d065 100644
--- a/libavcodec/libvo-aacenc.c
+++ b/libavcodec/libvo-aacenc.c
@@ -23,25 +23,61 @@
#include <vo-aacenc/cmnMemory.h>

#include "avcodec.h"
+#include "audio_frame_queue.h"
+#include "internal.h"
#include "mpeg4audio.h"

+#define FRAME_SIZE 1024
+#define ENC_DELAY  1600
+
typedef struct AACContext {
    VO_AUDIO_CODECAPI codec_api;
    VO_HANDLE handle;
    VO_MEM_OPERATOR mem_operator;
    VO_CODEC_INIT_USERDATA user_data;
+    VO_PBYTE end_buffer;
+    AudioFrameQueue afq;
+    int last_frame;
+    int last_samples;
} AACContext;

+
+static int aac_encode_close(AVCodecContext *avctx)
+{
+    AACContext *s = avctx->priv_data;
+
+    s->codec_api.Uninit(s->handle);
+#if FF_API_OLD_ENCODE_AUDIO
+    av_freep(&avctx->coded_frame);
+#endif
+    av_freep(&avctx->extradata);

This didn't use to clear extradata before. Is the reason just to make sure we don't leak it if aac_encode_init fails? (It's the last allocation done there, so it wasn't necessary before, but it's a good safeguard I guess.)

LGTM in general.

// Martin
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to