From 11909725e203034b12ea446bb7386cc0a1f66469 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Fri, 24 Jul 2009 08:19:31 +0200 Subject: [PATCH] Use ffmpeg's memory allocator for transcode buffer ffmpeg's allocator ensures the allocated memory is properly aligned for any kind of optimized operation used in ffmpeg. --- src/transcode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transcode.c b/src/transcode.c index 91e4b8df..05dd3d59 100644 --- a/src/transcode.c +++ b/src/transcode.c @@ -368,7 +368,7 @@ transcode_setup(struct media_file_info *mfi, size_t *est_size) if (ctx->fd != -1) DPRINTF(E_DBG, L_XCODE, "Set up raw mode for transcoding input\n"); - ctx->abuffer = (uint8_t *)malloc(XCODE_BUFFER_SIZE); + ctx->abuffer = (uint8_t *)av_malloc(XCODE_BUFFER_SIZE); if (!ctx->abuffer) { DPRINTF(E_WARN, L_XCODE, "Could not allocate transcode buffer\n"); @@ -408,7 +408,7 @@ transcode_cleanup(struct transcode_ctx *ctx) avcodec_close(ctx->acodec); av_close_input_file(ctx->fmtctx); - free(ctx->abuffer); + av_free(ctx->abuffer); free(ctx); }