From ddd1e13e53c4970058884e2af31c2681617e7bf3 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 15 Aug 2005 18:00:00 +0200 Subject: =?UTF-8?q?Version=201.3.29=20-=20Fixed=20a=20race=20condition=20i?= =?UTF-8?q?n=20cTransfer=20(thanks=20to=20Klaus=20Heppenheimer=20for=20rep?= =?UTF-8?q?orting=20this=20one).=20=20=20In=20doing=20so,=20the=20'active'?= =?UTF-8?q?=20variables=20used=20by=20the=20actual=20derived=20cThread=20c?= =?UTF-8?q?lasses=20=20=20have=20been=20replaced=20by=20the=20cThread::Run?= =?UTF-8?q?ning()=20function.=20=20=20Plugin=20authors=20may=20want=20to?= =?UTF-8?q?=20check=20their=20derived=20cThread=20classes=20and=20replace?= =?UTF-8?q?=20any=20'active'=20=20=20variables=20the=20same=20way=20as,=20?= =?UTF-8?q?for=20instance,=20done=20in=20transfer.c.=20-=20Fixed=20handlin?= =?UTF-8?q?g=20EPG=20data=20for=20time=20shifted=20events=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Increased=20the=20defaul?= =?UTF-8?q?t=20value=20for=20'Min.=20user=20inactivity'=20to=20300=20minut?= =?UTF-8?q?es=20(suggested=20=20=20by=20Helmut=20Auer).=20-=20Now=20storin?= =?UTF-8?q?g=20the=20channel=20id=20in=20the=20info.vdr=20file=20even=20if?= =?UTF-8?q?=20there=20is=20no=20EPG=20info=20=20=20available=20(thanks=20t?= =?UTF-8?q?o=20Andreas=20Brachold=20for=20reporting=20that=20there=20are?= =?UTF-8?q?=20empty=20info.vdr=20=20=20files=20created=20in=20that=20case)?= =?UTF-8?q?.=20-=20Added=20some=20'mkdir=20-p'=20to=20the=20Makefile's=20'?= =?UTF-8?q?install'=20target=20(thanks=20to=20Wayne=20Keer).=20-=20Changed?= =?UTF-8?q?=20the=20title=20of=20the=20recording=20info=20menu=20(thanks?= =?UTF-8?q?=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20handling=20the=20frame?= =?UTF-8?q?=20number=20display=20if=20'7'=20is=20pressed=20before=20the=20?= =?UTF-8?q?first=20editing=20=20=20mark,=20or=20'9'=20after=20the=20last?= =?UTF-8?q?=20one=20(thanks=20to=20Thomas=20G=C3=BCnther).=20-=20Now=20dis?= =?UTF-8?q?carding=20any=20previous=20numerical=20input=20to=20switch=20ch?= =?UTF-8?q?annels=20if=20Up,=20Down,=20Channel+,=20=20=20Channel-,=20Left?= =?UTF-8?q?=20or=20Right=20is=20pressed=20(thanks=20to=20Wolfgang=20Rohdew?= =?UTF-8?q?ald=20for=20reporting=20a=20=20=20problem=20with=20this).=20-?= =?UTF-8?q?=20Pressing=20Ok=20while=20entering=20a=20channel=20number=20no?= =?UTF-8?q?w=20immediately=20switches=20to=20that=20=20=20channel,=20witho?= =?UTF-8?q?ut=20waiting=20for=20further=20input.=20-=20Avoiding=20unnecess?= =?UTF-8?q?ary=20OSD=20draw=20operations=20caused=20by=20the=20audio=20tra?= =?UTF-8?q?ck=20description=20=20=20display=20in=20the=20ST:TNG=20skin's?= =?UTF-8?q?=20channel=20display=20(thanks=20to=20Oliver=20Endriss=20for=20?= =?UTF-8?q?reporting=20=20=20this).=20-=20Removed=20the=20VIDEO=5FSTILLPIC?= =?UTF-8?q?TURE=5FWORKS=5FWITH=5FVDR=5FFRAMES=20stuff=20from=20=20=20cDvbD?= =?UTF-8?q?evice::StillPicture(),=20since=20apparently=20the=20VIDEO=5FSTI?= =?UTF-8?q?LLPICTURE=20call=20works.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transfer.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'transfer.c') diff --git a/transfer.c b/transfer.c index c214b88..f34dea7 100644 --- a/transfer.c +++ b/transfer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: transfer.c 1.28 2005/02/19 14:38:55 kls Exp $ + * $Id: transfer.c 1.30 2005/08/14 10:55:03 kls Exp $ */ #include "transfer.h" @@ -21,7 +21,6 @@ cTransfer::cTransfer(int VPid, const int *APids, const int *DPids, const int *SP ringBuffer = new cRingBufferLinear(TRANSFERBUFSIZE, TS_SIZE * 2, true, "Transfer"); remux = new cRemux(VPid, APids, Setup.UseDolbyDigital ? DPids : NULL, SPids); needsBufferReserve = Setup.UseDolbyDigital && VPid != 0 && DPids && DPids[0] != 0; - active = false; } cTransfer::~cTransfer() @@ -34,21 +33,17 @@ cTransfer::~cTransfer() void cTransfer::Activate(bool On) { - if (On) { - if (!active) - Start(); - } - else if (active) { - active = false; + if (On) + Start(); + else Cancel(3); - } } void cTransfer::Receive(uchar *Data, int Length) { - if (IsAttached() && active) { + if (IsAttached() && Running()) { int p = ringBuffer->Put(Data, Length); - if (p != Length && active) + if (p != Length && Running()) ringBuffer->ReportOverflow(Length - p); return; } @@ -70,8 +65,7 @@ void cTransfer::Action(void) bool GotBufferReserve = false; int RequiredBufferReserve = KILOBYTE(DvbCardWith4MBofSDRAM ? 288 : 576); #endif - active = true; - while (active) { + while (Running()) { #ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 if (needsBufferReserve && !GotBufferReserve) { //XXX For dolby we've to fill the buffer because the firmware does @@ -145,7 +139,6 @@ void cTransfer::Action(void) } } } - active = false; } // --- cTransferControl ------------------------------------------------------ -- cgit v1.2.3