From cfac68ee8458c6b51e638dd787d931bd5baad57a Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 21 Apr 2002 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.0.1=20-=20Added=20some=20DVB-T=20channels?= =?UTF-8?q?=20for=20Berlin=20(Germany)=20to=20channels.conf.terr=20(thanks?= =?UTF-8?q?=20to=20=20=20Andreas=20Roedl).=20-=20Implemented=20enhanced=20?= =?UTF-8?q?string=20editing=20with=20upper-/lowercase,=20insert/overwrite?= =?UTF-8?q?=20=20=20and=20delete=20(thanks=20to=20Sergei=20Haller).=20-=20?= =?UTF-8?q?Fixed=20color=20palette=20handling=20on=20"big=20endian"=20syst?= =?UTF-8?q?ems=20(thanks=20to=20Jean=20Martin=20=20=20for=20pointing=20out?= =?UTF-8?q?=20this=20one).=20-=20Updated=20the=20"Blue=20Movie"=20channels?= =?UTF-8?q?=20to=20the=20new=20"Premiere=20Erotik"=20(thanks=20to=20=20=20?= =?UTF-8?q?Thilo=20Wunderlich).=20NOTE:=20this=20adds=20a=20new=20channel?= =?UTF-8?q?=20to=20'channels.conf',=20so=20that=20=20=20any=20timers=20ref?= =?UTF-8?q?erencing=20a=20channel=20with=20a=20number=20higher=20than=2010?= =?UTF-8?q?2=20should=20be=20=20=20checked=20and=20adapted=20if=20necessar?= =?UTF-8?q?y=20(this=20only=20applies=20if=20you=20are=20using=20the=20def?= =?UTF-8?q?ault=20=20=20'channels.conf').=20-=20Improved=20thread=20lockin?= =?UTF-8?q?g=20in=20the=20ring=20buffer=20to=20avoid=20possible=20race=20c?= =?UTF-8?q?onditions=20=20=20under=20heavy=20load=20(thanks=20to=20Werner?= =?UTF-8?q?=20Fink).=20-=20Fixed=20a=20crash=20when=20selecting=20the=20"J?= =?UTF-8?q?ump"=20function=20directly=20after=20setting=20an=20=20=20editi?= =?UTF-8?q?ng=20mark=20(thanks=20to=20Steffen=20Koch=20for=20reporting=20a?= =?UTF-8?q?nd=20Stefan=20Huelswitt=20for=20=20=20fixing=20this=20one).=20-?= =?UTF-8?q?=20Fixed=20some=20missing=20','=20in=20i18n.c=20(thanks=20to=20?= =?UTF-8?q?Matthias=20Hilbig).=20-=20Fixed=20a=20possible=20endless=20loop?= =?UTF-8?q?=20in=20shifting=20recordings=20between=20DVB=20cards=20(thanks?= =?UTF-8?q?=20=20=20to=20Stefan=20Huelswitt=20for=20reporting=20this=20one?= =?UTF-8?q?).=20-=20Updated=20the=20Premiere=20World=20Formula=201=20chann?= =?UTF-8?q?els=20in=20'channels.conf'=20(thanks=20to=20Mel=20=20=20Sch?= =?UTF-8?q?=C3=A4chner).=20-=20No=20longer=20setting=20PIDs=200x1FFF,=20wh?= =?UTF-8?q?ich=20apparently=20fixes=20problems=20with=20CAMs=20and=20=20?= =?UTF-8?q?=20AC3=20sound=20only=20working=20the=20first=20time=20(thanks?= =?UTF-8?q?=20to=20Stefan=20Huelswitt).=20-=20Now=20encoding=20'.'=20at=20?= =?UTF-8?q?the=20end=20of=20a=20directory=20name=20in=20case=20of=20VFAT?= =?UTF-8?q?=3D1,=20since=20Windows=20=20=20can't=20handle=20these=20(thank?= =?UTF-8?q?s=20to=20Simon=20Dean=20for=20reporting=20this=20one).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvbapi.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'dvbapi.c') diff --git a/dvbapi.c b/dvbapi.c index 9d59d90..0006e43 100644 --- a/dvbapi.c +++ b/dvbapi.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbapi.c 1.170 2002/04/07 09:35:51 kls Exp $ + * $Id: dvbapi.c 1.173 2002/04/21 11:55:48 kls Exp $ */ #include "dvbapi.h" @@ -533,6 +533,8 @@ void cRecordBuffer::Input(void) int w = Put(p, r); p += w; r -= w; + if (r > 0) + usleep(1); // this keeps the CPU load low } t = time(NULL); } @@ -1810,21 +1812,24 @@ bool cDvbApi::SetPrimaryDvbApi(int n) return false; } -int cDvbApi::CanShift(int Ca, int Priority) +int cDvbApi::CanShift(int Ca, int Priority, int UsedCards) { // Test whether a recording on this DVB device can be shifted to another one // in order to perform a new recording with the given Ca and Priority on this device: int ShiftLevel = -1; // default means this device can't be shifted + if (UsedCards & (1 << CardIndex()) != 0) + return ShiftLevel; // otherwise we would get into a loop if (Recording()) { if (ProvidesCa(Ca) // this device provides the requested Ca && (Ca != this->Ca() // the requested Ca is different from the one currently used... || Priority > this->Priority())) { // ...or the request comes from a higher priority cDvbApi *d = NULL; int Provides[MAXDVBAPI]; + UsedCards |= (1 << CardIndex()); for (int i = 0; i < NumDvbApis; i++) { if ((Provides[i] = dvbApi[i]->ProvidesCa(this->Ca())) != 0) { // this device is basicly able to do the job if (dvbApi[i] != this) { // it is not _this_ device - int sl = dvbApi[i]->CanShift(this->Ca(), Priority); // this is the original Priority! + int sl = dvbApi[i]->CanShift(this->Ca(), Priority, UsedCards); // this is the original Priority! if (sl >= 0 && (ShiftLevel < 0 || sl < ShiftLevel)) { d = dvbApi[i]; ShiftLevel = sl; @@ -2301,16 +2306,17 @@ bool cDvbApi::SetPid(int fd, dmxPesType_t PesType, int Pid, dmxOutput_t Output) { if (Pid) { CHECK(ioctl(fd, DMX_STOP)); - dmxPesFilterParams pesFilterParams; - pesFilterParams.pid = Pid; - pesFilterParams.input = DMX_IN_FRONTEND; - pesFilterParams.output = Output; - pesFilterParams.pesType = PesType; - pesFilterParams.flags = DMX_IMMEDIATE_START; - if (ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams) < 0) { - if (Pid != 0x1FFF) + if (Pid != 0x1FFF) { + dmxPesFilterParams pesFilterParams; + pesFilterParams.pid = Pid; + pesFilterParams.input = DMX_IN_FRONTEND; + pesFilterParams.output = Output; + pesFilterParams.pesType = PesType; + pesFilterParams.flags = DMX_IMMEDIATE_START; + if (ioctl(fd, DMX_SET_PES_FILTER, &pesFilterParams) < 0) { LOG_ERROR; - return false; + return false; + } } } return true; -- cgit v1.2.3