diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-16 09:36:28 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2004-10-16 09:36:28 +0200 |
commit | 6415cc900de3361925d22f879077be687fce3858 (patch) | |
tree | 98ab10cda016e125e33966e371ccfe01e5fd9bd1 /PLUGINS/src/sky | |
parent | 15030f6acece1060f9736f875fe3abbcf9392263 (diff) | |
download | vdr-6415cc900de3361925d22f879077be687fce3858.tar.gz vdr-6415cc900de3361925d22f879077be687fce3858.tar.bz2 |
Improved buffer handling
Diffstat (limited to 'PLUGINS/src/sky')
-rw-r--r-- | PLUGINS/src/sky/HISTORY | 4 | ||||
-rw-r--r-- | PLUGINS/src/sky/sky.c | 34 |
2 files changed, 17 insertions, 21 deletions
diff --git a/PLUGINS/src/sky/HISTORY b/PLUGINS/src/sky/HISTORY index c1c5f98e..2d15da7e 100644 --- a/PLUGINS/src/sky/HISTORY +++ b/PLUGINS/src/sky/HISTORY @@ -24,3 +24,7 @@ VDR Plugin 'sky' Revision History - Added automatic DST detection to getskyepg.pl. - Fixed handling receivers, so that a recording on the same channel won't interrupt an ongoing Transfer mode. + +2004-10-16: Version 0.3.1 + +- Improved buffer handling. diff --git a/PLUGINS/src/sky/sky.c b/PLUGINS/src/sky/sky.c index 6196eefc..eea697ea 100644 --- a/PLUGINS/src/sky/sky.c +++ b/PLUGINS/src/sky/sky.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: sky.c 1.6 2004/02/15 14:59:46 kls Exp $ + * $Id: sky.c 1.7 2004/10/16 09:10:06 kls Exp $ */ #include <sys/socket.h> @@ -14,7 +14,7 @@ #include <vdr/plugin.h> #include <vdr/sources.h> -static const char *VERSION = "0.3.0"; +static const char *VERSION = "0.3.1"; static const char *DESCRIPTION = "Sky Digibox interface"; // --- cDigiboxDevice -------------------------------------------------------- @@ -140,7 +140,7 @@ bool cDigiboxDevice::OpenDvr(void) CloseDvr(); fd_dvr = open("/dev/video2", O_RDONLY | O_NONBLOCK);//XXX parameter??? if (fd_dvr >= 0) - tsBuffer = new cTSBuffer(fd_dvr, KILOBYTE(256), CardIndex() + 1); + tsBuffer = new cTSBuffer(fd_dvr, MEGABYTE(2), CardIndex() + 1); return fd_dvr >= 0; } @@ -157,24 +157,16 @@ void cDigiboxDevice::CloseDvr(void) bool cDigiboxDevice::GetTSPacket(uchar *&Data) { if (tsBuffer) { - int r = tsBuffer->Read(); - if (r >= 0) { - Data = tsBuffer->Get(); - if (Data) { - // insert the actual PIDs: - int Pid = (((uint16_t)Data[1] & PID_MASK_HI) << 8) | Data[2]; - if (Pid == DUMMYAPID) - Pid = apid; - else if (Pid == DUMMYVPID) - Pid = vpid; - Data[1] = ((Pid >> 8) & 0xFF) | (Data[1] & ~PID_MASK_HI); - Data[2] = Pid & 0xFF; - } - return true; - } - else if (FATALERRNO) { - LOG_ERROR; - return false; + Data = tsBuffer->Get(); + if (Data) { + // insert the actual PIDs: + int Pid = (((uint16_t)Data[1] & PID_MASK_HI) << 8) | Data[2]; + if (Pid == DUMMYAPID) + Pid = apid; + else if (Pid == DUMMYVPID) + Pid = vpid; + Data[1] = ((Pid >> 8) & 0xFF) | (Data[1] & ~PID_MASK_HI); + Data[2] = Pid & 0xFF; } return true; } |