new_codec: resolve a bug fix while decoding audio.
authorKitae Kim <kt920.kim@samsung.com>
Fri, 10 May 2013 06:53:57 +0000 (15:53 +0900)
committerKitae Kim <kt920.kim@samsung.com>
Wed, 11 Sep 2013 05:05:57 +0000 (14:05 +0900)
solve the memory problem when codec device copies
the decoded audio buffer from host to guest.

Change-Id: I86185f672bd8ea0d097ca58cabc0097cbb240c5e
Signed-off-by: Kitae Kim <kt920.kim@samsung.com>
tizen/src/hw/maru_new_codec.c

index 17606457367893c540e0e1075531c2295f96415c..a4f0643061f85a90c3abf604b26b44d9921bbfa7 100644 (file)
@@ -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",