OSDN Git Service

[1841509] Fails to play the audio with the attached video
authorSahil Sachdeva <sahils@google.com>
Wed, 17 Jun 2009 00:46:44 +0000 (17:46 -0700)
committerSahil Sachdeva <sahils@google.com>
Wed, 17 Jun 2009 00:46:44 +0000 (17:46 -0700)
For the content, size of the audio config buffer exceeds the size of the audio config data
because of which the extra bits were taken as a part of next raw aac stream, which resulted in
bit stream corruption.
Fix, force to consume all bits of the audio config buffer.

codecs_v2/omx/omx_aac/src/aac_decode_frame.cpp

index 9ff292b..00686b5 100644 (file)
@@ -138,16 +138,15 @@ Int OmxAacDecoder::AacDecodeFrames(OMX_S16* aOutputBuffer,
             *aSamplesPerFrame = AACDEC_PCM_FRAME_SAMPLE_SIZE;
         }
 
-        *aInBufSize -= iExt.inputBufferUsedLength;
 
-        if (0 == *aInBufSize)
-        {
-            iInputUsedLength = 0;
-        }
-        else
-        {
-            iInputUsedLength = iExt.inputBufferUsedLength;
-        }
+        /*
+         *  *aInBufSize -= iExt.inputBufferUsedLength;  should render *aInBufSize == 0,
+         *  If the size of the audio config buffer exceeds the size of the audio config data
+         *  the excess bits could be taken as part of next raw aac stream. To avoid that
+         *  we force to consume all bits of the audio config buffer, by making *aInBufSize == 0
+         */
+        *aInBufSize = 0;
+        iInputUsedLength = 0;
 
         return Status;
     }