[Protocol-dev] CR: ou1cimx1#514330: Fusion: System error occurs when streaming a wmv excerpt link.
ext-debashis.2.panigrahi at nokia.com ext-debashis.2.panigrahi at nokia.com"Nokia submits this code under the terms of a commercial contribution agreement with Real Networks, and I am authorized to contribute this code under said agreement." Modified by: ext-debashis.2.panigrahi at nokia.com Reviewed by: Junhong.Liu at nokia.com RC Id: ou1cimx1#514330 Date: 08/16/2010 Project: SymbianMmf_wm Synopsis: Fusion: System error occurs when streaming a wmv excerpt link. Overview: The content here is a dynamic link, which causes seek to be called before play has started. Whereas there is no provision to handle such as state/ condition in wm protocol. Therefore when HXMSG_WMNET_BEGIN_SELECT_STREAMS message is issued, it fails with HXR_UNEXPECTED and this systematically gets propagated as "System Error" Fix: To handle such a condition a new state has been introduced here "kThreadStateEndSelectStreamsPendingFromSeeked". So when ThreadHandleBeginSelectStreams(.) is called after SeekDone, this new state captures the state transition. Then causes the Play to defer till ThreadHandleEndSelectStreams(.) is called, thereby causing the playback to start from the seeked position. Files modified & changes: wmcode-protocol/rtsp/fileformat/asf_file_format_net.cpp wmcode-protocol/rtsp/fileformat/pub/asf_file_format_net.h Image Size and Heap Use impact: No major impact Module Release testing (STIF) : Passed Test case(s) Added : No Memory leak check performed : Passed, No additional leaks introduced. Platforms and Profiles Build Verified: helix-client-s60-52-mmf-mdf-dsp Platforms and Profiles Functionality verified: armv5, winscw Branch: 210CayS, 420Bizo and HEAD CVS Diff on 210CayS: <Attached> -------------- next part -------------- Index: asf_file_format_net.cpp =================================================================== RCS file: /cvsroot/wmcode-protocol/rtsp/fileformat/asf_file_format_net.cpp,v retrieving revision 1.15.10.22 diff -u -w -r1.15.10.22 asf_file_format_net.cpp --- asf_file_format_net.cpp 13 Mar 2010 09:45:29 -0000 1.15.10.22 +++ asf_file_format_net.cpp 9 Aug 2010 10:38:49 -0000 @@ -4962,8 +4962,10 @@ HX_ASSERT(m_pNetClient && pMsg); if (m_pNetClient && pMsg) { - HX_ASSERT(m_ulThreadState == kThreadStateHeadersSent || m_ulThreadState == kThreadStatePlaying); - if (m_ulThreadState == kThreadStateHeadersSent || m_ulThreadState == kThreadStatePlaying) + HX_ASSERT(m_ulThreadState == kThreadStateHeadersSent || m_ulThreadState == kThreadStatePlaying || + m_ulThreadState == kThreadStateSeeked); + if (m_ulThreadState == kThreadStateHeadersSent || m_ulThreadState == kThreadStatePlaying || + m_ulThreadState == kThreadStateSeeked) { HRESULT hr = S_OK; if (!m_pStreamSwitchInfo) @@ -5122,9 +5124,18 @@ if (m_pNetStreamSwitchArray->Size() > 0) { // Set the thread state - m_ulThreadState = (m_ulThreadState == kThreadStateHeadersSent ? - kThreadStateEndSelectStreamsPendingFromHeadersSent : - kThreadStateEndSelectStreamsPendingFromPlaying); + if (m_ulThreadState == kThreadStateHeadersSent) + { + m_ulThreadState = kThreadStateEndSelectStreamsPendingFromHeadersSent; + } + else if (m_ulThreadState == kThreadStateSeeked) + { + m_ulThreadState = kThreadStateEndSelectStreamsPendingFromSeeked; + } + else + { + m_ulThreadState = kThreadStateEndSelectStreamsPendingFromPlaying; + } // Call CRTSPClient::BeginSelectStreams. When this is complete, // we will get a callback to CASFFileFormatNet::OnSelectStreams() hr = m_pNetClient->BeginSelectStreams(m_pNetStreamSwitchArray->P(), @@ -5164,16 +5175,19 @@ if (pMsg) { HX_ASSERT(m_ulThreadState == kThreadStateEndSelectStreamsPendingFromHeadersSent || - m_ulThreadState == kThreadStateEndSelectStreamsPendingFromPlaying); + m_ulThreadState == kThreadStateEndSelectStreamsPendingFromPlaying || + m_ulThreadState == kThreadStateEndSelectStreamsPendingFromSeeked); if (m_ulThreadState == kThreadStateEndSelectStreamsPendingFromHeadersSent || - m_ulThreadState == kThreadStateEndSelectStreamsPendingFromPlaying) + m_ulThreadState == kThreadStateEndSelectStreamsPendingFromPlaying || + m_ulThreadState == kThreadStateEndSelectStreamsPendingFromSeeked) { // Get the return value of EndSelectStreams HRESULT hr = (HRESULT) pMsg->m_pParam1; if (SUCCEEDED(hr)) { // Set the thread state - m_ulThreadState = (m_ulThreadState == kThreadStateEndSelectStreamsPendingFromHeadersSent ? + m_ulThreadState = ((m_ulThreadState == kThreadStateEndSelectStreamsPendingFromHeadersSent || + m_ulThreadState == kThreadStateEndSelectStreamsPendingFromSeeked) ? kThreadStateStreamsSelected : kThreadStatePlaying); // Did we have to defer the call to BeginPlay()? if (m_bDeferredBeginPlay) @@ -5240,11 +5254,13 @@ m_ulThreadState == kThreadStateStreamsSelected || m_ulThreadState == kThreadStateSeeked || m_ulThreadState == kThreadStateEndSelectStreamsPendingFromHeadersSent || + m_ulThreadState == kThreadStateEndSelectStreamsPendingFromSeeked || m_ulThreadState == kThreadStateEndPausePending); if (m_ulThreadState == kThreadStatePaused || m_ulThreadState == kThreadStateStreamsSelected || m_ulThreadState == kThreadStateSeeked || m_ulThreadState == kThreadStateEndSelectStreamsPendingFromHeadersSent || + m_ulThreadState == kThreadStateEndSelectStreamsPendingFromSeeked || m_ulThreadState == kThreadStateEndPausePending) { // Clear the deferred BeginPlay flag @@ -5291,6 +5307,7 @@ m_ulThreadState = kThreadStateEndPlayPendingFromSeeked; break; case kThreadStateEndSelectStreamsPendingFromHeadersSent: + case kThreadStateEndSelectStreamsPendingFromSeeked: // The command to begin playing came from the main app // thread before the SETUP response arrived from the server // via the EndSelectStreams message. Therefore, we need to cvs diff: Diffing pub Index: pub/asf_file_format_net.h =================================================================== RCS file: /cvsroot/wmcode-protocol/rtsp/fileformat/pub/asf_file_format_net.h,v retrieving revision 1.7.10.7 diff -u -w -r1.7.10.7 asf_file_format_net.h --- pub/asf_file_format_net.h 29 Apr 2009 22:14:46 -0000 1.7.10.7 +++ pub/asf_file_format_net.h 9 Aug 2010 10:38:50 -0000 @@ -237,6 +237,7 @@ kThreadStateHeadersSent, kThreadStateEndSelectStreamsPendingFromHeadersSent, kThreadStateEndSelectStreamsPendingFromPlaying, + kThreadStateEndSelectStreamsPendingFromSeeked, kThreadStateStreamsSelected, kThreadStateEndPlayPendingFromPaused, kThreadStateEndPlayPendingFromStreamsSelected,