[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mdf/audio/arm/wma/platform/symbian
From:       anuj_dhamija () helixcommunity ! org
Date:       2008-06-26 21:52:43
Message-ID: 200806262154.m5QLsJu3006684 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/mdf/audio/arm/wma/platform/symbian
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv18482

Modified Files:
      Tag: hxclient_2_2_1_cayennes
	wmasymbianswdecoder.cpp 
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement with \
RealNetworks, and I am authorized to contribute this code under said agreement."  
Modified by:  ext-anuj.dhamija@nokia.com
 
Reviewed by: 
 
Date: 06/24/2008
 
Project: SymbianMmf_wm
 
Synopsis: Silence during playback of WMA file

TSW ID: MSUA-7FNGB5

Overview: 
In method HXSymbianWMASwAudioDecoder::Decode,  before calling Decode() [call to real \
decoder], a header of 24 bytes is prepended and number of bytes to be decoded is \
incremented by 24. After call to Decode() the frame size (24) is deducted from both: \
number of bytes to be decoded and number of bytes actually decoded (consumed). \
Sometimes decoder does not consume any bytes and returns 0 as bytes consumed. \
Deducting header size from bytes consumed thus results in a negative value which gets \
converted to a very large positive value when stored in unsigned long variable. This \
causes number of bytes consumed to become greater than number of bytes to decode and \
consequentially current frame is skipped.  
Fix:
In method HXSymbianWMASwAudioDecoder::Decode if call to Decode() returns zero number \
                of bytes consumed then:
- Do not deduct headersize from number of bytes to decode and number of bytes \
                consumed
- Set the flag to indicate new payload to true. This is required so that when same \
frame is parsed using HXSymbianWMASwAudioDecoder::Decode next time, it will be \
treated as first call to Decode for this frame. Also reset other variables as these \
would be now reinitialised on next call to HXSymbianWMASwAudioDecoder::Decode. If \
this is not done then next call to HXSymbianWMASwAudioDecoder::Decode treats it as if \
decoding partial frame (i.e. residual of frame that was deocoded last time) and \
headersize is initialised to zero (assuming header is already taken careof when \
called first time). But since headersize was not deducted last time it causes \
problem.

Files modified & changes:
datatype/mdf/audio/arm/wma/platform/symbian/wmasymbianswdecoder.cpp

Image Size and Heap Use impact: None

Module Release testing (STIF, Audio) : Passed

Test case(s) Added  : No

Memory leak check performed : Passed, No leaks found
  
Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-arm

Platforms and Profiles Functionality verified: armv5
  
Branch: Head, 210CayS, 221Cays


Index: wmasymbianswdecoder.cpp
===================================================================
RCS file: /cvsroot/datatype/mdf/audio/arm/wma/platform/symbian/wmasymbianswdecoder.cpp,v
 retrieving revision 1.1.2.1
retrieving revision 1.1.2.1.2.1
diff -u -d -r1.1.2.1 -r1.1.2.1.2.1
--- wmasymbianswdecoder.cpp	10 Jan 2008 19:25:35 -0000	1.1.2.1
+++ wmasymbianswdecoder.cpp	26 Jun 2008 21:52:41 -0000	1.1.2.1.2.1
@@ -265,14 +265,23 @@
     // Sanity checker update
     m_expectedBytes = nBytes - nBytesConsumed;
 
-    // Subtract the header size on the first decode call
-    nBytesConsumed = nBytesConsumed - headerSize;
-    nBytes = nBytes - headerSize; 
+    if(nBytesConsumed > 0)
+    {
+        // Subtract the header size on the first decode call
+        nBytesConsumed = nBytesConsumed - headerSize;
+        nBytes = nBytes - headerSize; 
+    }
 
     HX_ASSERT(nBytesConsumed <= nBytes);
 
+    if(nBytesConsumed == 0)
+    {
+        HX_VECTOR_DELETE(m_buffer);
+        iNewPayload = ETrue;
+        m_expectedBytes = -1;
+    }
     // Still decoding
-    if( nBytesConsumed < nBytes)
+    else if( nBytesConsumed < nBytes)
     {
         HXLOGL2(HXLOG_WMAR, "CWMAudioDecoder::Decode decoding incomplete consumed %d \
of %d\n",nBytesConsumed,nBytes);  iNewPayload = EFalse;        


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic