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

List:       helix-server-cvs
Subject:    [Server-cvs] engine/session clientsession.cpp, 1.72.2.41.2.45.2.8,
From:       svaidhya () helixcommunity ! org
Date:       2009-05-30 21:09:48
Message-ID: 20090530221425.4B07B30ADC5 () pukcab ! korelogic ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/session
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv32005

Modified Files:
      Tag: SERVER_13_0
	clientsession.cpp 
Log Message:
Synopsis
========
Fix for Switching (to a compatible content) does not happen after an invalid switch \
request was made accidentally


Branches:  SERVER_CURRENT, SERVER_13_0
Reviewer(s):  Jamie

Description
===========

There are 2 problems here

1]
When switching to an inactive RM live feed,
the player went into communicating mode.
This was happening because the after the issuing the s/w request, brcvplin returns a \
HXR_NOT_FOUND (since stream inactive) which flows down to clientSession::FindDone.

FindDone, on seeing a failure, goes ahead and terminates the session (Wrongly), not \
considering that it is a s/w request rather than a normal playback request.

Fix: In case of a failure with s/w request, just populate the log entry and remove \
the req from stack (which is done by the HandleSourceSwitch method, so just call that \
method).

2]
When switching to an inactive RTP live feed,
ideally the player should behave the same way as with RM live streams.
But it worked fine , though the logs were incorrect, because, qtbcplin returns a \
DoesExistDone(HXR_FAIL) for inactive stream instead of DoesExistDone(FALSE). HXR_FAIL \
is considered as TRUE and finally a HXR_OK is returned to FindDone.

FindDone then calls HandleSourceSwitch() which is responsible for doing the \
Switchability check. Now when the clientsession tries to get the Stream for doing the \
Switchability test, it fails. The clientsession gives out a 274 assuming a if the \
stream is inactive it would have already being handled in FindDone(which is correct).

Fix: Change to DoesExistDone(FALSE)


Files Affected
==============

./server/broadcast/transport/rtp/recv/qtbcobj.cpp
./server/engine/session/clientsesion.cpp


Testing Performed
=================
Unit Tests:
None.

Integration Tests:
- Verified the following

FCS Switching
~~~~~~~~~~~~~
1. Switching from OnDemand clip to Inactive live rm stream gives a 404 not found and \
the rest of the  s/w works fine as expected.
2. Switching from OnDemand clip to Inactive live RTP stream gives a 404 not found and \
the rest of  the s/w works fine as expected.
2. Switching from an OnDemand Clip to an Non Existing On Deamnd clip works fine

SSPL
~~~~
1. Empty playlist
2. Playlist where the First clip Doesn't Exist
3. Playlist where no clips exist
4. Playlist with Inactive Live clips works fine and give correct logs

Leak Tests:
- None.

Performance Tests:
None.

Platforms Tested:  win32-i386-vc7
Build verified:    win32-i386-vc7



Index: clientsession.cpp
===================================================================
RCS file: /cvsroot/server/engine/session/clientsession.cpp,v
retrieving revision 1.72.2.41.2.45.2.8
retrieving revision 1.72.2.41.2.45.2.9
diff -u -d -r1.72.2.41.2.45.2.8 -r1.72.2.41.2.45.2.9
--- clientsession.cpp	21 May 2009 19:05:42 -0000	1.72.2.41.2.45.2.8
+++ clientsession.cpp	30 May 2009 21:09:45 -0000	1.72.2.41.2.45.2.9
@@ -1121,7 +1121,7 @@
     if (FAILED(pStreamHeader->GetPropertyULONG32("StreamGroupNumber",
                         unStreamGroupNumber)))
     {
-	unStreamGroupNumber = stream_number;
+        unStreamGroupNumber = stream_number;
     }
 
     IHXBuffer* pTemp = NULL;
@@ -1466,10 +1466,10 @@
             pInfo->m_pActualHeader->GetPropertyCString("MimeType",
                                                         mime_type);
 
-	    // if the audio/video/event/etc. streams have different durations
-	    // set the m_ulClipDuration to the highest one
-	    if (duration > m_ulClipDuration)
-		m_ulClipDuration = duration;
+            // if the audio/video/event/etc. streams have different durations
+            // set the m_ulClipDuration to the highest one
+            if (duration > m_ulClipDuration)
+                m_ulClipDuration = duration;
 
             if (m_pRegistryKey && m_pClient->UseRegistryForStats())
             {
@@ -2025,17 +2025,12 @@
         return HXR_OK;
     }
 
-    /**
-     * The Following Code is Moved from ::got_url for incorporating MDP for Live \
                Streams
-     * In the got_url method we cannot find out if the stream is live/onDemand
-     * Hence moved the code here
-     **/
-
-    if (SUCCEEDED(status))
-    {
 #ifdef HELIX_FEATURE_SERVER_FCS
+        /* HXR_NO_MORE_FILES is only returned in case of empty playlist or other \
undesirable cases +         * when we should not proceed with playlist
+         */
         CSwitchElement* pSwitchElement = NULL;
-        if(m_pStack->GetSize())
+        if(m_pStack->GetSize() && (status != HXR_NO_MORE_FILES))
         {
             pSwitchElement = (CSwitchElement*)m_pStack->GetAt(m_uTestIndex);
             pSwitchElement->GetStat(pFileObject);
@@ -2044,6 +2039,14 @@
         }
 #endif //HELIX_FEATURE_SERVER_FCS
 
+    /**
+     * The Following Code is Moved from ::got_url for incorporating MDP for Live \
Streams +     * In the got_url method we cannot find out if the stream is \
live/onDemand +     * Hence moved the code here
+     **/
+
+    if (SUCCEEDED(status))
+    {
         /*
          * We don't use MDP for MEI (block transfer) requests.  If it is ever
          * desired to do so, the code in FindDone() and the MDP call semantics
@@ -2164,46 +2167,39 @@
     {
 #ifdef HELIX_FEATURE_SERVER_SSPL
         if(m_bIsPlaylist && m_pPlaylistControl && status != HXR_NO_MORE_FILES)
-        {
-            //If this is not the first clip in the playlist
-            if (m_pStack->GetSize())
-            {
-                HandleSourceSwitch(HXR_FILE_NOT_FOUND, 0, 0);
-            }
-            else
-            {
-
-              //Set URL for the first clip in the Paylist (Not Found)
-              const char* pClipPath = NULL;
-              IHXBuffer* pClipURL = new ServerBuffer(TRUE);
-              m_pRequest->GetURL(pClipPath);
-              pClipURL->Set((UCHAR*)pClipPath, (strlen(pClipPath) + 1));
-              m_pClipStats->SetURL(pClipURL);
-              HX_RELEASE(pClipURL);
+        {           
+            //Set URL for the first clip in the Paylist (Not Found)
+            const char* pClipPath = NULL;
+            IHXBuffer* pClipURL = new ServerBuffer(TRUE);
+            m_pRequest->GetURL(pClipPath);
+            pClipURL->Set((UCHAR*)pClipPath, (strlen(pClipPath) + 1));
+            m_pClipStats->SetURL(pClipURL);
+            HX_RELEASE(pClipURL);
 
-              //Set Status
-              m_pClipStats->SetStatus(404);
+            //Set Status
+            m_pClipStats->SetStatus(404);
 
-              //Log it
-              m_pProc->pc->client_stats_manager->ClipDone(m_pClient->GetClientStats(),
                
-                                                            m_pStats,
-                                                            m_pClipStats,
-                                                            m_pProc);
+            //Log it
+            m_pProc->pc->client_stats_manager->ClipDone(m_pClient->GetClientStats(),
+                                                                           m_pStats,
+                                                                           \
m_pClipStats, +                                                                       \
m_pProc);  
+            // We call GetFirstMediaClip instead of GetNextMediaClip here because we \
haven't +            // played the first clip of the session yet.
             m_bGettingFirstClip = TRUE;
             m_pPlaylistControl->GetFirstMediaClip();
-            //continue on SSPLMediaClipReady();
-        }
-        }
+           //continue on SSPLMediaClipReady();
+        }  
         else
 #endif //HELIX_FEATURE_SERVER_SSPL
-        {
+            {
         if (m_pSourceControl)
         {
             m_pSourceControl->Done();
         }
         m_pClient->GetProtocol()->setupStreams(0, this, CONVERT_HXR_ERROR(status));
-    }
+                }
     }
 
     // Left Function
@@ -2883,7 +2879,7 @@
         if (!m_bInBandSeeking && m_ulClipBegin && m_ulClipDuration && 
                 m_ulClipBegin < m_ulClipDuration)
         {
-	    DPRINTF(D_PLMINFO, ("begin: m_ulClipBegin=%lu, m_ulClipDuration=%lu\n", \
m_ulClipBegin, m_ulClipDuration)); +            DPRINTF(D_PLMINFO, ("begin: \
m_ulClipBegin=%lu, m_ulClipDuration=%lu\n", m_ulClipBegin, m_ulClipDuration));  \
m_pSourceControl->DoInternalSeek(m_ulClipBegin);  m_ulClipBegin = 0;
         }
@@ -4109,7 +4105,7 @@
 {
     if (m_ppStreams)
     {
-	return m_ppStreams[unStreamNumber]->m_bSetupReceived;
+        return m_ppStreams[unStreamNumber]->m_bSetupReceived;
     }
 
     return FALSE;
@@ -4494,11 +4490,11 @@
 
                 IHXClipStats2* pClipStats2 = NULL;
                 if (SUCCEEDED(m_pClipStats->QueryInterface(IID_IHXClipStats2, (void \
                **)&pClipStats2)))
-		{
+                {
                     //Set for the first clip here
                     pClipStats2->SetOriginPlaylist(m_pOriginPlaylist);
                     HX_RELEASE(pClipStats2);
-		}
+                }
 
                 m_pPlaylistControl = new CPlaylistControl(this, \
m_pProc->pc->server_context);  m_pPlaylistControl->AddRef();
@@ -6388,11 +6384,11 @@
         //For the first clip t is set in ::OnURLDone
         //To be set only for playlist files
         IHXClipStats2* pClipStats2 = NULL;
-	if (SUCCEEDED(pClipStats->QueryInterface(IID_IHXClipStats2, (void \
**)&pClipStats2))) +        if \
(SUCCEEDED(pClipStats->QueryInterface(IID_IHXClipStats2, (void **)&pClipStats2)))  {
             pClipStats2->SetOriginPlaylist(m_pOriginPlaylist);
             HX_RELEASE(pClipStats2);
-	}
+        }
 
         if (m_pPlaylistControl)
         {
@@ -7100,10 +7096,10 @@
 #ifdef HELIX_FEATURE_SERVER_FCS
     if(m_bWatchForStreamDone)
     {
-    	if (m_pClientSession->IsStreamSetup(unStreamNumber))
+        if (m_pClientSession->IsStreamSetup(unStreamNumber))
         {
         m_usStreamDoneCalled++;
-	}
+        }
 
         if(m_usStreamDoneCalled == m_usNumOfStreams)
         {


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs


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

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