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

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] mpeg2ts/fileformat tsfformat.cpp, 1.20.2.13,
From:       qluo () helixcommunity ! org
Date:       2011-04-29 16:33:07
Message-ID: 201104291632.p3TGWuMu002601 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/mpeg2ts/fileformat
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv1411/fileformat

Modified Files:
      Tag: hxclient_3_1_0_atlas
	tsfformat.cpp 
Log Message:
merge demuxer fix to branch.


Index: tsfformat.cpp
===================================================================
RCS file: /cvsroot/datatype/mpeg2ts/fileformat/tsfformat.cpp,v
retrieving revision 1.20.2.13
retrieving revision 1.20.2.14
diff -u -d -r1.20.2.13 -r1.20.2.14
--- tsfformat.cpp	6 Apr 2011 19:17:32 -0000	1.20.2.13
+++ tsfformat.cpp	29 Apr 2011 16:33:05 -0000	1.20.2.14
@@ -407,10 +407,9 @@
     UINT32 ulStreamNum = (UINT32) usStreamNo;
     if (m_pStreamInfo && ulStreamNum < m_ulStreamCount)
     {
-        if (!m_pStreamInfo[ulStreamNum].m_bPacketRequested &&
-            !m_pStreamInfo[ulStreamNum].m_bStreamDone)
+        if (!m_pStreamInfo[ulStreamNum].m_bStreamDone)
         {
-            // there is no pending request nor StreamDone issued.
+            // there is no StreamDone issued.
             // try to get packet from demuxer
             retVal = HXR_OK;
             IHXRTPPacket* pPacket = NULL;
@@ -454,8 +453,7 @@
             // Release the packet
             HX_RELEASE(pPacket);
         }
-        // Do nothing if there is a pending packet request for this stream or
-        // the StreamDone is issued on this stream
+        // Do nothing if the StreamDone is issued on this stream
     }
 
     return retVal;
@@ -547,10 +545,16 @@
 STDMETHODIMP CTSFileFormat::ReadDone(HX_RESULT status, IHXBuffer* pBuffer)
 {
     HX_RESULT retVal = status;
+    
+    if (status == HXR_AT_END && pBuffer == NULL)
+    {
+        m_bEndOfFileReached = TRUE;
+        retVal = HXR_OK;
+    }
 
     UINT32 ulReadSize = 0;
     BYTE* pData = NULL;
-    if (SUCCEEDED(status) && pBuffer)
+    if (SUCCEEDED(retVal) && pBuffer)
     {
         ulReadSize = pBuffer->GetSize();
         m_ulFileOffset += ulReadSize;
@@ -562,7 +566,7 @@
         }
     }
 
-    if (SUCCEEDED(status) && m_eStatus == ScanEndTimeReadPending)
+    if (SUCCEEDED(retVal) && m_eStatus == ScanEndTimeReadPending)
     {
         retVal = m_pTSDemuxer->ScanEndTime(pData, ulReadSize);
 


_______________________________________________
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