From 24ba179b0cc0a535650bb14bc62f1c894625bbf3 Mon Sep 17 00:00:00 2001 From: Kitae Kim Date: Fri, 10 May 2013 15:53:57 +0900 Subject: [PATCH] new_codec: resolve a bug fix while decoding audio. solve the memory problem when codec device copies the decoded audio buffer from host to guest. Change-Id: I86185f672bd8ea0d097ca58cabc0097cbb240c5e Signed-off-by: Kitae Kim --- tizen/src/hw/maru_new_codec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tizen/src/hw/maru_new_codec.c b/tizen/src/hw/maru_new_codec.c index 1760645736..a4f0643061 100644 --- a/tizen/src/hw/maru_new_codec.c +++ b/tizen/src/hw/maru_new_codec.c @@ -915,7 +915,7 @@ static void new_avcodec_decode_audio_to(AVCodecContext *avctx, int len, size += sizeof(len); memcpy(mem_buf + size, &frame_size_ptr, sizeof(frame_size_ptr)); size += sizeof(frame_size_ptr); -#if 0 +#if 1 if (len > 0) { memcpy(mem_buf + size, samples, outbuf_size); } @@ -1460,7 +1460,7 @@ int new_avcodec_decode_audio(NewCodecState *s, CodecParam *ioparam) frame_size_ptr = AVCODEC_MAX_AUDIO_FRAME_SIZE; outbuf_size = frame_size_ptr; -#if 0 +#if 1 samples = av_mallocz(frame_size_ptr); if (!samples) { ERR("[%d] failed to allocate memory\n", __LINE__); @@ -1468,8 +1468,10 @@ int new_avcodec_decode_audio(NewCodecState *s, CodecParam *ioparam) } #endif +#if 0 size = sizeof(avctx->channel_layout) + sizeof(len) + sizeof(frame_size_ptr); samples = (int16_t *)((uint8_t *)s->vaddr + ioparam->mem_offset + size); +#endif len = avcodec_decode_audio3(avctx, samples, &frame_size_ptr, &avpkt); TRACE("decoding audio! len %d. channel_layout %ld, frame_size %d\n", -- 2.34.1