From 30b7dfd5db791d41291eac0e9d3829df3d9dde71 Mon Sep 17 00:00:00 2001 From: lordjaxom Date: Sun, 24 Apr 2005 16:21:59 +0000 Subject: [PATCH] - removed assembler and thus saving one ringbuffer - fixed destruction order on channel switch (fixes one crash that happens occasionally when switching) --- client/device.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/client/device.c b/client/device.c index dd5ed55..5652c13 100644 --- a/client/device.c +++ b/client/device.c @@ -1,5 +1,5 @@ /* - * $Id: device.c,v 1.5 2005/02/08 17:22:35 lordjaxom Exp $ + * $Id: device.c,v 1.6 2005/04/24 16:21:59 lordjaxom Exp $ */ #include "client/device.h" @@ -117,12 +117,13 @@ bool cStreamdevDevice::SetPid(cPidHandle *Handle, int Type, bool On) { bool cStreamdevDevice::OpenDvr(void) { Dprintf("OpenDvr\n"); + CloseDvr(); if (ClientSocket.CreateDataConnection(siLive)) { - m_Assembler = new cStreamdevAssembler(ClientSocket.DataSocket(siLive)); - m_TSBuffer = new cTSBuffer(m_Assembler->ReadPipe(), MEGABYTE(2), - CardIndex() + 1); + //m_Assembler = new cStreamdevAssembler(ClientSocket.DataSocket(siLive)); + //m_TSBuffer = new cTSBuffer(m_Assembler->ReadPipe(), MEGABYTE(2), CardIndex() + 1); + m_TSBuffer = new cTSBuffer(*ClientSocket.DataSocket(siLive), MEGABYTE(2), CardIndex() + 1); Dprintf("waiting\n"); - m_Assembler->WaitForFill(); + //m_Assembler->WaitForFill(); Dprintf("resuming\n"); return true; } @@ -132,9 +133,9 @@ bool cStreamdevDevice::OpenDvr(void) { void cStreamdevDevice::CloseDvr(void) { Dprintf("CloseDvr\n"); - ClientSocket.CloseDvr(); + //DELETENULL(m_Assembler); DELETENULL(m_TSBuffer); - DELETENULL(m_Assembler); + ClientSocket.CloseDvr(); } bool cStreamdevDevice::GetTSPacket(uchar *&Data) { @@ -143,26 +144,6 @@ bool cStreamdevDevice::GetTSPacket(uchar *&Data) { return true; } return false; - /*int r; - while ((r = m_TSBuffer->Read()) >= 0) { - Data = m_TSBuffer->Get(); -#if VDRVERSNUM >= 10300 // --> TODO: no filter streaming yet - if (Data != NULL) { - u_short pid = (((u_char)Data[1] & PID_MASK_HI) << 8) | Data[2]; - u_char tid = Data[3]; - if (m_Filters->Matches(pid, tid)) { - m_Filters->Put(Data); - continue; - } - } -#endif - return true; - } - if (FATALERRNO) { - LOG_ERROR; - return false; - } - return true;*/ } #if VDRVERSNUM >= 10300