[Datatype-cvs] wm/audio/renderer wmaformat.h,1.3,1.3.4.1
anuj_dhamija at helixcommunity.org anuj_dhamija at helixcommunity.orgUpdate of /cvsroot/datatype/wm/audio/renderer
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv12600
Modified Files:
Tag: hxclient_2_1_0_cayennes
wmaformat.h
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 at nokia.com
Reviewed by:
Date: 05/21/2008
Project: SymbianMmf_wm
TSW Error ID: DHAR_7DLSSC
Synopsis: Multiple Audio Streams in WMV File cause Helix Audiocontroller Crash
Overview:
In WM Audio Format (CWMAduiFormat::UpdateAudioFormat) output buffer for decoded data is allocated with size for the stream which is selected as initial active stream based on sampling rate and number of channels (in CWMAudioFormat::ChooseInitialActiveSubStream method). This buffer is then used for decoder output disregard of the fact that which stream gets decoded. As long as the decoded stream is of less bitrate than the one chosen as active, there is no problem. But when the stream to be decoded is of higher bit rate than the one chosen as active ,then decoded output overflows the output buffer causing the crash.
Fix:
Instead of allocating the output decoder buffer with respect to the selected stream, allocate it outside UpdateAudioFormat method using the size of stream which requires maximum decoder buffer size.
Introduce new Function AllocateDecoderBuffer which scans through all the substreams and selects theh max buffer size and use that to allocate decoder buffer. Remove the logic of allocating decoder buffer from UpdateAudioFormat function.
Files modified & changes:
src\datatype\wm\audio\renderer\wmaformat.cpp
src\datatype\wm\audio\renderer\wmaformat.h
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-50-mmf-mdf-arm
Platforms and Profiles Functionality verified: armv5
Branch: Head, 210CayS, 221Cays, 310Atlas
Index: wmaformat.h
===================================================================
RCS file: /cvsroot/datatype/wm/audio/renderer/wmaformat.h,v
retrieving revision 1.3
retrieving revision 1.3.4.1
diff -u -d -r1.3 -r1.3.4.1
--- wmaformat.h 5 Jul 2006 14:49:56 -0000 1.3
+++ wmaformat.h 23 May 2008 15:38:10 -0000 1.3.4.1
@@ -100,7 +100,8 @@
// Protected CWMAudioFormat methods
void _Reset(void);
- void ClearDecoderArray(void);
+ void ClearDecoderArray(void);
+ HX_RESULT AllocateDecoderBuffer();
HX_RESULT UpdateAudioFormat(UINT32& rulAnchorTime, HXBOOL bForceUpdate = FALSE);
HX_RESULT ParseOpaqueData(IHXBuffer* pBuffer);
HX_RESULT ChooseInitialActiveSubStream(void);