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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] httplive/fileformat/parsers m3u8.cpp,1.9,1.10
From:       qluo () helixcommunity ! org
Date:       2010-06-30 22:28:20
Message-ID: 201006302228.o5UMSHK8007972 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/httplive/fileformat/parsers
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv9083/parsers

Modified Files:
	m3u8.cpp 
Log Message:
take care of key list.


Index: m3u8.cpp
===================================================================
RCS file: /cvsroot/datatype/httplive/fileformat/parsers/m3u8.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- m3u8.cpp	29 Jun 2010 17:01:59 -0000	1.9
+++ m3u8.cpp	30 Jun 2010 22:28:17 -0000	1.10
@@ -95,18 +95,6 @@
         HX_DELETE(pAltStream->pPlaylistURL);
         HX_DELETE(pAltStream->pCodecNames);
 
-        // key file list
-        if (pAltStream->pKeyList)
-        {
-            while (!(pAltStream->pKeyList->IsEmpty()))
-            {
-                KeyFileInfo_t* pKeyFileInfo = (KeyFileInfo_t*)pAltStream->pKeyList->RemoveHead();
-                HX_DELETE(pKeyFileInfo->pStrURL);
-                HX_DELETE(pKeyFileInfo);
-            }
-            HX_DELETE(pAltStream->pKeyList);
-        }
-
         // TS playlist
         if (pAltStream->pSegmentPlaylist)
         {
@@ -115,6 +103,7 @@
                 SegmentInfo_t* pTSInfo = (SegmentInfo_t*)pAltStream->pSegmentPlaylist->RemoveHead();
                 HX_DELETE(pTSInfo->pStrTitle);
                 HX_DELETE(pTSInfo->pStrURL);
+                HX_DELETE(pTSInfo->pStrKeyURI);
                 HX_DELETE(pTSInfo);
             }
             HX_DELETE(pAltStream->pSegmentPlaylist);
@@ -147,11 +136,9 @@
         pDstTSPlayList->ulSequenceStart  = pSrcTSPlayList->ulSequenceStart;
         pDstTSPlayList->ulSequenceEnd    = pSrcTSPlayList->ulSequenceEnd;
         pDstTSPlayList->bAllowCache      = pSrcTSPlayList->bAllowCache;
-        pDstTSPlayList->pKeyList         = pSrcTSPlayList->pKeyList;
         pDstTSPlayList->pSegmentPlaylist = pSrcTSPlayList->pSegmentPlaylist;
 
         pSrcTSPlayList->pStrTitle        = NULL;
-        pSrcTSPlayList->pKeyList         = NULL;
         pSrcTSPlayList->pSegmentPlaylist = NULL;
 
     }
@@ -165,6 +152,7 @@
             {
                 HX_DELETE(pTSInfo->pStrTitle);
                 HX_DELETE(pTSInfo->pStrURL);
+                HX_DELETE(pTSInfo->pStrKeyURI);
                 HX_DELETE(pTSInfo);
             }
             else if (pTSInfo->ulSequenceNumber != (pDstTSPlayList->ulSequenceEnd+1))
@@ -436,8 +424,11 @@
             GetNameValuePair(pPos, pName, pValue);
             if (pName && pValue && strcmp(pName, URI_NAME) == 0)
             {
+                // strip double quote
+                pValue++;
+                pValue[strlen(pValue)-1] = '\0';
                 // save key uri
-                m_pTempTSPlayList->pKeyURLStr = new CHXString(pValue);
+                m_pTempTSRecord->pStrKeyURI = new CHXString(pValue);
                 retVal = HXR_OK;
             }
         }
@@ -489,7 +480,13 @@
 
     HX_RESULT retVal = HXR_OK;
 
-    if (m_bTSFileURIPending)
+    if (m_bTSFileURIPending && IsLineStartWith(KEY_TAG, KEY_TAG_LEN))
+    {
+        // there are servers that put the key URI inside of the ts marker
+        // we need to process key tag
+        retVal = ParseKeyEntry();
+    }
+    else if (m_bTSFileURIPending)
     {
         // TS file uri
         m_pTempTSRecord->pStrURL = new CHXString(m_pLine);
@@ -529,6 +526,7 @@
         // TS record marker, specific ts file duration, title
         // create TS segment record
         m_pTempTSRecord = (SegmentInfo_t*) new (SegmentInfo_t);
+        memset(m_pTempTSRecord, 0, sizeof(SegmentInfo_t));
         retVal = ParseDurationTitle();
         m_bTSFileURIPending = TRUE;
     }


_______________________________________________
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