Commit 5f141f6a authored by Andrew de Quincey's avatar Andrew de Quincey

Fixed looping for PS streams to be as it should (i.e. a counter counting down)

Apologies for my slight confusion
parent 8deaf4c0
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* filereader.cpp: file reader * filereader.cpp: file reader
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: filereader.cpp,v 1.12 2003/08/20 14:45:47 adq Exp $ * $Id: filereader.cpp,v 1.13 2003/08/20 21:26:56 adq Exp $
* *
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
...@@ -79,9 +79,6 @@ C_FileMpegReader::C_FileMpegReader(C_Module* pModule, ...@@ -79,9 +79,6 @@ C_FileMpegReader::C_FileMpegReader(C_Module* pModule,
C_MpegReader(pModule, pBroadcast), C_MpegReader(pModule, pBroadcast),
m_cFile(pBroadcast->GetOption("filename")) m_cFile(pBroadcast->GetOption("filename"))
{ {
m_iLoop = pBroadcast->GetOption("loop").ToInt();
if(m_iLoop) m_iLoop--;
if(pBroadcast->GetOption("end") == "1") if(pBroadcast->GetOption("end") == "1")
m_bEnd = true; m_bEnd = true;
else else
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* filereader.h: file reader * filereader.h: file reader
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: filereader.h,v 1.8 2003/08/13 23:04:21 adq Exp $ * $Id: filereader.h,v 1.9 2003/08/20 21:26:56 adq Exp $
* *
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
...@@ -54,7 +54,6 @@ public: ...@@ -54,7 +54,6 @@ public:
protected: protected:
C_File m_cFile; C_File m_cFile;
s32 m_iLoop;
bool m_bEnd; bool m_bEnd;
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ps2ts.cpp: MPEG1 and MPEG2 PS to MPEG2 TS converter * ps2ts.cpp: MPEG1 and MPEG2 PS to MPEG2 TS converter
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: ps2ts.cpp,v 1.12 2003/08/20 21:06:06 adq Exp $ * $Id: ps2ts.cpp,v 1.13 2003/08/20 21:26:56 adq Exp $
* *
* Authors: Benoit Steiner <benny@via.ecp.fr> * Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
...@@ -53,7 +53,7 @@ template <class Reader, class TsProvider> ...@@ -53,7 +53,7 @@ template <class Reader, class TsProvider>
C_Ps2Ts<Reader, TsProvider>::C_Ps2Ts(Reader* pReader, TsProvider* pTsProvider, C_Ps2Ts<Reader, TsProvider>::C_Ps2Ts(Reader* pReader, TsProvider* pTsProvider,
unsigned int iMaxBufferedTs, unsigned int iMaxBufferedTs,
unsigned int iMpegVersion, unsigned int iMpegVersion,
bool bLooping, int iLoop,
handle hLog) : handle hLog) :
m_cPgrmDescriptor(iMpegVersion), m_cPgrmDescriptor(iMpegVersion),
m_cPat(0, 0, 0), m_cPmt(0, 0, 0, 0, 0x50), m_cPat(0, 0, 0), m_cPmt(0, 0, 0, 0, 0x50),
...@@ -78,7 +78,7 @@ C_Ps2Ts<Reader, TsProvider>::C_Ps2Ts(Reader* pReader, TsProvider* pTsProvider, ...@@ -78,7 +78,7 @@ C_Ps2Ts<Reader, TsProvider>::C_Ps2Ts(Reader* pReader, TsProvider* pTsProvider,
m_bNeedToSendPCR = true; m_bNeedToSendPCR = true;
m_iNextPCR = 0; m_iNextPCR = 0;
m_iPrevPCR = 0; m_iPrevPCR = 0;
m_bLooping = bLooping; m_iLoop = iLoop;
m_bInMiddleOfPES = false; m_bInMiddleOfPES = false;
m_bJustSynched = false; m_bJustSynched = false;
m_hLog = hLog; m_hLog = hLog;
...@@ -251,7 +251,7 @@ template <class Reader, class TsProvider> ...@@ -251,7 +251,7 @@ template <class Reader, class TsProvider>
break; break;
case END_OF_STREAM: case END_OF_STREAM:
if (m_bLooping) { if (m_iLoop) {
// try and reset the stream // try and reset the stream
m_pReader->ResetEndOfStream(); m_pReader->ResetEndOfStream();
...@@ -266,6 +266,7 @@ template <class Reader, class TsProvider> ...@@ -266,6 +266,7 @@ template <class Reader, class TsProvider>
m_bSendPSI = true; m_bSendPSI = true;
m_bGenPat = true; m_bGenPat = true;
m_bGenPmt = true; m_bGenPmt = true;
m_iLoop--;
} }
break; break;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ps2ts.h: MPEG1 and MPEG2 PS to TS converter * ps2ts.h: MPEG1 and MPEG2 PS to TS converter
*------------------------------------------------------------------------------- *-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN * (c)1999-2001 VideoLAN
* $Id: ps2ts.h,v 1.6 2003/08/14 14:45:49 adq Exp $ * $Id: ps2ts.h,v 1.7 2003/08/20 21:26:56 adq Exp $
* *
* Authors: Benoit Steiner <benny@via.ecp.fr> * Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
...@@ -37,7 +37,7 @@ template <class Reader, class TsProvider> class C_Ps2Ts ...@@ -37,7 +37,7 @@ template <class Reader, class TsProvider> class C_Ps2Ts
{ {
public: public:
C_Ps2Ts(Reader* pReader, TsProvider* pTsProvider, unsigned int iMaxBufferedTs, C_Ps2Ts(Reader* pReader, TsProvider* pTsProvider, unsigned int iMaxBufferedTs,
unsigned int iMpegVersion, bool bLooping, handle hLog); unsigned int iMpegVersion, int iLoop, handle hLog);
~C_Ps2Ts(); ~C_Ps2Ts();
// Find the first pack header in the stream // Find the first pack header in the stream
...@@ -99,7 +99,7 @@ template <class Reader, class TsProvider> class C_Ps2Ts ...@@ -99,7 +99,7 @@ template <class Reader, class TsProvider> class C_Ps2Ts
int m_iStatus; int m_iStatus;
u64 m_iNextPCR; u64 m_iNextPCR;
bool m_bNeedToSendPCR; bool m_bNeedToSendPCR;
bool m_bLooping; int m_iLoop;
u8 m_bCache[512]; u8 m_bCache[512];
int m_iCacheLen; int m_iCacheLen;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment