- fixed a segfault in dvbpsi stuff;

  - fixed a segfault in the DVB input when an error occurs during
    initialization;
  - fixed error during input initialization handling in the manager.
parent a85a568b
......@@ -2,7 +2,7 @@
* dvbinput.cpp: DVB streams
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbinput.cpp,v 1.1 2002/03/21 14:09:19 bozo Exp $
* $Id: dvbinput.cpp,v 1.2 2002/03/25 01:23:54 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -198,23 +198,28 @@ void C_DvbInput::OnInit()
void C_DvbInput::OnDestroy()
{
// Unselect the PAT PID
C_TsDemux::Lock();
UnselectPid(&m_cPatDecoder, 0x0000);
C_TsDemux::UnLock();
// PAT Decoder destruction
m_cPatDecoder.Detach();
// Stop the input stream
try
{
m_pConverter->Stop();
}
catch(E_Exception e)
if(m_pConverter)
{
// Stop the input stream
try
{
m_pConverter->Stop();
}
catch(E_Exception e)
{
delete m_pConverter;
throw e;
}
delete m_pConverter;
throw e;
}
delete m_pConverter;
}
......
......@@ -2,7 +2,7 @@
* dvbpsi.cpp: common tools to use the libdvbpsi
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: dvbpsi.cpp,v 1.2 2002/03/21 19:03:54 bozo Exp $
* $Id: dvbpsi.cpp,v 1.3 2002/03/25 01:23:54 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -339,6 +339,7 @@ C_DvbPsiPatDecoder::C_DvbPsiPatDecoder(C_NetList *pTsProvider,
{
ASSERT(pTsProvider);
m_hDvbPsi = NULL;
m_pTsProvider = pTsProvider;
m_pHandler = pHandler;
}
......@@ -362,8 +363,11 @@ void C_DvbPsiPatDecoder::Attach()
//------------------------------------------------------------------------------
void C_DvbPsiPatDecoder::Detach()
{
ASSERT(m_hDvbPsi);
dvbpsi_DetachPAT(m_hDvbPsi);
if(m_hDvbPsi)
{
dvbpsi_DetachPAT(m_hDvbPsi);
m_hDvbPsi = NULL;
}
}
......@@ -650,6 +654,7 @@ C_DvbPsiPmtDecoder::C_DvbPsiPmtDecoder(u16 iProgramNumber,
{
ASSERT(pTsProvider);
m_hDvbPsi = NULL;
m_iProgramNumber = iProgramNumber;
m_pTsProvider = pTsProvider;
m_pHandler = pHandler;
......@@ -675,8 +680,11 @@ void C_DvbPsiPmtDecoder::Attach()
//------------------------------------------------------------------------------
void C_DvbPsiPmtDecoder::Detach()
{
ASSERT(m_hDvbPsi);
dvbpsi_DetachPMT(m_hDvbPsi);
if(m_hDvbPsi)
{
dvbpsi_DetachPMT(m_hDvbPsi);
m_hDvbPsi = NULL;
}
}
......
......@@ -2,7 +2,7 @@
* manager.cpp: Vls manager
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: manager.cpp,v 1.6 2002/03/13 12:32:48 asmax Exp $
* $Id: manager.cpp,v 1.7 2002/03/25 01:23:54 bozo Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -248,12 +248,23 @@ void C_Manager::InitInputs()
ASSERT(pInput);
pInput->SetEventHandler(this);
Log(m_hLog, LOG_NOTE, "Starting input '"+strInputName+"'");
pInput->Init();
try
{
// Initialize the input
pInput->Init();
// And register it
m_cInputList.Add(strInputName, pInput);
// And register it
m_cInputList.Add(strInputName, pInput);
Log(m_hLog, LOG_NOTE, "Input '"+strInputName+"' sucessfully initialised");
Log(m_hLog, LOG_NOTE, "Input '" + strInputName +
"' sucessfully initialised");
}
catch(E_Exception e)
{
Log(m_hLog, LOG_ERROR, "Unable to start input '" + strInputName +
"': " + e.Dump());
delete pInput;
}
}
else
{
......
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