sleep(5) -> C_Condition.

parent 3ef466c0
......@@ -2,7 +2,7 @@
* dvbinput.cpp: DVB streams
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbinput.cpp,v 1.4 2002/03/27 23:38:34 bozo Exp $
* $Id: dvbinput.cpp,v 1.5 2002/04/02 15:22:08 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -181,11 +181,13 @@ void C_DvbInput::OnInit()
m_pConverter = pConverterModule->NewMpegConverter(cConfig);
ASSERT(m_pConverter);
m_cEndInit.Protect();
// Launch the demux
m_pConverter->Create();
// Kludge: wait for 5 seconds to get a PAT and then build the program table
sleep(5);
// Kludge: wait for the first PAT arrival.
m_cEndInit.Wait();
}
......@@ -211,12 +213,15 @@ void C_DvbInput::OnDestroy()
}
catch(E_Exception e)
{
m_cEndInit.Release();
delete m_pConverter;
throw e;
}
delete m_pConverter;
}
m_cEndInit.Release();
}
......@@ -389,6 +394,10 @@ void C_DvbInput::OnDvbPsiPatEvent(int iEvent)
m_cLock.Lock();
m_cCurrentPat = *m_pCurrentPat;
m_cLock.UnLock();
// Kludge: signal the first PAT arrival.
m_cEndInit.Protect();
m_cEndInit.Signal();
}
}
......
......@@ -2,7 +2,7 @@
* dvbinput.h: DVB Input class definition
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbinput.h,v 1.2 2002/03/26 19:51:50 bozo Exp $
* $Id: dvbinput.h,v 1.3 2002/04/02 15:22:08 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -81,6 +81,9 @@ private:
int m_iLnbLof2;
int m_iLnbSLof;
// Kludge: signal the first PAT arrival.
C_Condition m_cEndInit;
// Demuxes' file descriptors
int m_iDemuxes[64];
......
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