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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mp4/payload mp4apyld.cpp,1.14.14.9,1.14.14.10
From:       henryxing () helixcommunity ! org
Date:       2012-12-19 10:16:58
[Download RAW message or body]

Update of /cvsroot/datatype/mp4/payload
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv22027

Modified Files:
      Tag: hxclient_3_1_0_atlas
	mp4apyld.cpp 
Log Message:
hxc260 fix the crash issue of discontinuity hls url on 161.105.176.25

Index: mp4apyld.cpp
===================================================================
RCS file: /cvsroot/datatype/mp4/payload/mp4apyld.cpp,v
retrieving revision 1.14.14.9
retrieving revision 1.14.14.10
diff -u -d -r1.14.14.9 -r1.14.14.10
--- mp4apyld.cpp	21 Mar 2012 01:22:37 -0000	1.14.14.9
+++ mp4apyld.cpp	19 Dec 2012 10:16:50 -0000	1.14.14.10
@@ -92,6 +92,7 @@
     , m_uADTSCurSamplingFreIndex(0)
     , m_uADTSCurProfile(0)
     , m_bADTSFirstPacket(TRUE)
+    , m_ulDiscontinuityTS(0)
 {
     ;
 }
@@ -1073,12 +1074,25 @@
                     m_bPriorLoss = FALSE;
                 }
 
+                //if meet the discontinuity tag, adts packet offset was reset to 0 
+                UINT32 ulPktTime = pPacket->GetTime();
+                if (ucASMFlags & HX_ASM_DISCONTINUITY && m_ulDiscontinuityTS != \
ulPktTime) +                {
+                    m_ulDiscontinuityTS = ulPktTime;
+                    m_ulADTSCurrentPacketOffset = 0;
+                }
                 // ADTS AUs can be aggregated into one packets
                 // we'll extract one AU here
+                UINT32 ulBufSize = pBuffer->GetSize();
+                UINT32 ulSize = ulBufSize - m_ulADTSCurrentPacketOffset;
                 UINT8* pAU = pBuffer->GetBuffer() + m_ulADTSCurrentPacketOffset;
-                UINT32 ulSize = pBuffer->GetSize() - m_ulADTSCurrentPacketOffset;
-
-                if (pAU[0] != 0xFF || (pAU[1] & 0xF0) != 0xF0 || ulSize < 7)
+                if (ulBufSize < m_ulADTSCurrentPacketOffset)
+                {
+                    //meet some problems if m_ulADTSCurrentPacketOffset is bigger \
than ulBufSize, currently also treat it as lost  +                    m_bPriorLoss = \
TRUE; +                    retVal = HXR_INCOMPLETE;
+                }
+                else if(pAU[0] != 0xFF || (pAU[1] & 0xF0) != 0xF0 || ulSize < 7)
                 {
                     //error, treat the packet as lost
                     m_bPriorLoss = 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