[Helix-client-dev] CR: [Bug 11177] [U1]:The wma file can be played successfully, but if seek forward, there is no audio sometimes
Renjie Huang <[email protected]> Thu, 7 Oct 2010 09:59:11 -0700
| Newsgroups | gmane.comp.multimedia.helix.devel |
|---|---|
| Message-ID | <[email protected]> |
Date: 2010-10-7
Project: RealPlayer for Android Smartphones
Synopsis: The Windows Media Audio 9 Voice decoder gets false information when seek forward and thus fails decode the bitstream.
Overview: For audio clips in format of Windows Media Audio 9 Voice, when seek forward, Helix entered REBUFFERING mode due to audio underflow; but it does not return back to REBUFDONE and drains all packets causing no sound. The reason: When fake decoder decoding a speech superframe, it checks if there is any trailing silence bits. When seek forward, the result of the check becomes true, which is wrong. Then the decoder continues to check wheather having enough bits to decode the trailing silence bits, it will find that the number of bits is beyond the valid range (psdec->m_nSamplesPerFrame * psdec->m_nFramesPerSuperframe) = 480. In the original code, the decoder simply returns FAILURE, and there is always audio data underflow causing all packets drained immediately. Still unable to figure out why the check of trailing silence bits becomes true when seek forward. In this workaround fix, if the detectes the bit number is beyond the range of psdec->m_nSamplesPerFrame * psdec->m_nFramesPerSuperframe, do not set *pcSampleReady and do not return FAIL neither so that the decoder can continue to decode and feed data to audio device.
Changed files: datatype-restricted/wm/audio/codec/wma9voice/import/wmspv9_dec/audio/wmspeech/v10/stvoicedec/wmsdecstream.c
Platforms and Profiles Affected:
Platform: hxclient_3_6_1_atlas, hxclient_3_6_2_atlas
Profile: helix-client-android
Distribution Libraries Affected:
NA
Distribution library impact and planned action:
NA
Platforms and Profiles Build Verified:
Platform: hxclient_3_6_1_atlas
Profile: helix-client-android
Platforms and Profiles Functionality verified:
Platform: hxclient_3_6_1_atlas
Profile: helix-client-android
Branch: hxclient_3_6_1_atlas
Copyright assignment: I am a RealNetworks employee or contractor
Index: wmsdecstream.c
===================================================================
RCS file: /cvsroot/wmcode-audio/codec/wma9voice/import/wmspv9_dec/audio/wmspeech/v10/stvoicedec/wmsdecstream.c,v
retrieving revision 1.1.2.2
diff -u -w -r1.1.2.2 wmsdecstream.c
--- wmsdecstream.c 9 Dec 2008 07:37:02 -0000 1.1.2.2
+++ wmsdecstream.c 7 Oct 2010 01:52:01 -0000
@@ -170,11 +170,13 @@
*piBitsEnd = iEnd;
return(TraceResult(WMA_E_ONHOLD));
} else {
- *pcSampleReady = prvExtractBits(pbDataPtr,
+ U32 uSampleReadyTmp = prvExtractBits(pbDataPtr,
(*piBitsEnd)-TRAILING_SILENCE_BITS, TRAILING_SILENCE_BITS);
+
//assert(*pcSampleReady <= (U32)(psdec->m_nSamplesPerFrame * psdec->m_nFramesPerSuperframe));
- if (*pcSampleReady > (U32)(psdec->m_nSamplesPerFrame * psdec->m_nFramesPerSuperframe)) {
- return(TraceResult(WMA_E_FAIL));
+ if (uSampleReadyTmp <= (U32)(psdec->m_nSamplesPerFrame * psdec->m_nFramesPerSuperframe))
+ {
+ *pcSampleReady = uSampleReadyTmp;
}
}
}