From dbacda8274e2d76b0ea42f90b94353b672fa9343 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 13 Feb 2005 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.21=20-=20Fixed=20cDvbDevice::SetAudioTrac?= =?UTF-8?q?kDevice()=20to=20avoid=20a=20blank=20screen=20after=20switching?= =?UTF-8?q?=20=20=20back=20to=20live=20mode=20if=20a=20recording=20is=20cu?= =?UTF-8?q?rrently=20active=20on=20the=20primary=20device.=20-=20Fixed=20a?= =?UTF-8?q?=20possible=20freeze=20in=20pause=20mode=20in=20case=20a=20devi?= =?UTF-8?q?ce's=20PlayPesPacket()=20function=20=20=20permanently=20returns?= =?UTF-8?q?=200=20(thanks=20to=20Reinhard=20Nissl=20and=20Olaf=20Titz).=20?= =?UTF-8?q?-=20Completed=20the=20Finnish=20OSD=20texts=20(thanks=20to=20Ro?= =?UTF-8?q?lf=20Ahrenberg).=20-=20Restricted=20the=20"setting=20audio=20tr?= =?UTF-8?q?ack"=20log=20message=20to=20automatic=20changes=20during=20repl?= =?UTF-8?q?ay.=20-=20Fixed=20handling=20Transfer=20Mode=20for=20radio=20ch?= =?UTF-8?q?annels=20(thanks=20to=20Andreas=20Regel=20for=20=20=20reporting?= =?UTF-8?q?=20this=20one).=20-=20Fixed=20handling=20symbolic=20links=20in?= =?UTF-8?q?=20cRecordings::ScanVideoDir()=20(thanks=20to=20Stefan=20=20=20?= =?UTF-8?q?Huelswitt).=20-=20Completed=20the=20Danish=20OSD=20texts=20(tha?= =?UTF-8?q?nks=20to=20Mogens=20Elneff).=20-=20Forcing=20a=20new=20resync?= =?UTF-8?q?=20after=20a=20call=20to=20cRemux::Clear()=20(suggested=20by=20?= =?UTF-8?q?Marco=20Schl=C3=BC=C3=9Fler).=20-=20The=20cAudio::Play()=20func?= =?UTF-8?q?tion=20now=20has=20an=20additional=20parameter=20'uchar=20Id'?= =?UTF-8?q?=20which=20tells=20=20=20the=20function=20the=20substream=20id?= =?UTF-8?q?=20of=20the=20given=20audio=20packet,=20so=20that=20a=20plugin?= =?UTF-8?q?=20can=20=20=20take=20the=20right=20action=20for=20the=20variou?= =?UTF-8?q?s=20kinds=20if=20audio=20data=20-=20which=20now=20also=20includ?= =?UTF-8?q?es=20=20=20"normal"=20audio=20with=20ids=200xC0...0xDF=20(based?= =?UTF-8?q?=20on=20suggestions=20by=20Werner=20Fink=20and=20Macro=20=20=20?= =?UTF-8?q?Schl=C3=BC=C3=9Fler).=20-=20Removed=20the=20"Cleared/PlayPes(NU?= =?UTF-8?q?LL,=200)"=20handling=20from=20cTransfer::Action(),=20since=20th?= =?UTF-8?q?is=20=20=20is=20now=20done=20when=20attaching=20the=20player=20?= =?UTF-8?q?to=20the=20device=20(thanks=20to=20Marco=20Schl=C3=BC=C3=9Fler)?= =?UTF-8?q?.=20-=20Making=20sure=20the=20buffer=20reserve=20in=20cTransfer?= =?UTF-8?q?::Action()=20is=20re-established=20after=20=20=20clearing=20the?= =?UTF-8?q?=20buffer.=20-=20Added=20DeviceClrAvailableTracks()=20and=20Dev?= =?UTF-8?q?iceSetCurrentAudioTrack()=20to=20cPlayer=20=20=20(thanks=20to?= =?UTF-8?q?=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Fixed=20a=20typo=20in=20?= =?UTF-8?q?detecting=20UTF-8=20(thanks=20to=20Reinhard=20Nissl).=20-=20Now?= =?UTF-8?q?=20using=20twice=20the=20buffer=20reserve=20in=20cTransfer=20if?= =?UTF-8?q?=20the=20primary=20DVB=20card=20is=20an=20=20=20unmodified=20ve?= =?UTF-8?q?rsion=20with=20only=202MB=20of=20SDRAM,=20to=20avoid=20audio=20?= =?UTF-8?q?stuttering=20when=20=20=20playing=20Dolby=20Digital=20over=20th?= =?UTF-8?q?e=20DVB=20card=20(thanks=20to=20Christian=20Jacobsen=20and=20Ch?= =?UTF-8?q?ad=20=20=20Flynt=20for=20suggestions=20and=20experiments=20in?= =?UTF-8?q?=20that=20area).=20-=20Making=20sure=20the=20first=20audio=20pa?= =?UTF-8?q?cket=20is=20not=20dropped=20when=20switching=20to=20"pre=201.3.?= =?UTF-8?q?19=20=20=20Dolby=20Digital=20compatibility=20mode".=20-=20The?= =?UTF-8?q?=20'plugins-clean'=20target=20of=20the=20Makefile=20now=20only?= =?UTF-8?q?=20deletes=20the=20actual=20plugin=20=20=20library=20files=20fr?= =?UTF-8?q?om=20this=20version=20of=20VDR=20(suggested=20by=20Andreas=20Br?= =?UTF-8?q?achold).=20-=20Added=20a=20missing=20'resultSkipped=20=3D=200'?= =?UTF-8?q?=20to=20cRemux::Clear()=20(thanks=20to=20Marco=20Schl=C3=BC?= =?UTF-8?q?=C3=9Fler=20=20=20for=20reporting=20this=20one).=20-=20The=20ne?= =?UTF-8?q?w=20function=20cDvbDevice::SetTransferModeForDolbyDigital()=20c?= =?UTF-8?q?an=20be=20used=20by=20=20=20plugins=20that=20implement=20Dolby?= =?UTF-8?q?=20Digital=20output=20and=20thus=20want=20to=20prevent=20the=20?= =?UTF-8?q?cDvbDevice=20=20=20from=20starting=20Transfer=20Mode=20in=20ord?= =?UTF-8?q?er=20to=20replay=20DD=20over=20the=20DVB=20device.=20-=20Added?= =?UTF-8?q?=20missing=20reset=20of=20the=20'repacker'=20to=20cTS2PES::Clea?= =?UTF-8?q?r()=20(thanks=20to=20Marco=20=20=20Schl=C3=BC=C3=9Fler=20for=20?= =?UTF-8?q?reporting=20this=20one).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- transfer.c | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'transfer.c') diff --git a/transfer.c b/transfer.c index b3cbec4..331ac62 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.25 2005/01/23 14:27:40 kls Exp $ + * $Id: transfer.c 1.27 2005/02/12 15:54:06 kls Exp $ */ #include "transfer.h" @@ -54,24 +54,26 @@ void cTransfer::Receive(uchar *Data, int Length) } } +#define FW_NEEDS_BUFFER_RESERVE_FOR_AC3 +#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 +//XXX This is a very ugly hack to allow cDvbOsd to reduce the buffer +//XXX requirements in cTransfer if it detects a 4MB full featured DVB card. +bool DvbCardWith4MBofSDRAM = false; +#endif + void cTransfer::Action(void) { int PollTimeouts = 0; uchar *p = NULL; int Result = 0; -#define FW_NEEDS_BUFFER_RESERVE_FOR_AC3 #ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 - bool Cleared = false; bool GotBufferReserve = false; + int RequiredBufferReserve = KILOBYTE(DvbCardWith4MBofSDRAM ? 288 : 576); #endif active = true; while (active) { #ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 - if (needsBufferReserve) { - if (IsAttached() && !Cleared) { - PlayPes(NULL, 0); - Cleared = true; - } + if (needsBufferReserve && !GotBufferReserve) { //XXX For dolby we've to fill the buffer because the firmware does //XXX not decode dolby but use a PCM stream for transport, therefore //XXX the firmware has not enough buffer for noiseless skipping early @@ -79,14 +81,12 @@ void cTransfer::Action(void) //XXX audio is mostly to early in comparison to video). //XXX To resolve this, the remuxer or PlayPes() should synchronize //XXX audio with the video frames. 2004/09/09 Werner - if (!GotBufferReserve) { - if (ringBuffer->Available() < 3 * KILOBYTE(192) / 2) { // used to be MAXFRAMESIZE, but the HDTV value of KILOBYTE(512) is way too much here - cCondWait::SleepMs(20); // allow the buffer to collect some reserve - continue; - } - else - GotBufferReserve = true; + if (ringBuffer->Available() < RequiredBufferReserve) { // used to be MAXFRAMESIZE, but the HDTV value of KILOBYTE(512) is way too much here + cCondWait::SleepMs(20); // allow the buffer to collect some reserve + continue; } + else + GotBufferReserve = true; } #endif int Count; @@ -98,10 +98,14 @@ void cTransfer::Action(void) // So let's clear the buffer instead of suffering from permanent // overflows. dsyslog("clearing transfer buffer to avoid overflows"); + DeviceClear(); ringBuffer->Clear(); remux->Clear(); PlayPes(NULL, 0); p = NULL; +#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 + GotBufferReserve = false; +#endif continue; } Count = remux->Put(b, Count); @@ -132,7 +136,11 @@ void cTransfer::Action(void) DeviceClear(); ringBuffer->Clear(); remux->Clear(); + PlayPes(NULL, 0); p = NULL; +#ifdef FW_NEEDS_BUFFER_RESERVE_FOR_AC3 + GotBufferReserve = false; +#endif } } } -- cgit v1.2.3