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 --- device.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'device.c') diff --git a/device.c b/device.c index 46e23bc..f270b5a 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 1.87 2005/02/06 14:10:37 kls Exp $ + * $Id: device.c 1.92 2005/02/13 09:51:48 kls Exp $ */ #include "device.h" @@ -756,7 +756,8 @@ void cDevice::EnsureAudioTrack(bool Force) // Make sure we're set to an available audio track: const tTrackId *Track = GetTrack(GetCurrentAudioTrack()); if (Force || !Track || !Track->id || PreferredTrack != GetCurrentAudioTrack()) { - dsyslog("setting audio track to %d", PreferredTrack); + if (!Force) // only log this for automatic changes + dsyslog("setting audio track to %d", PreferredTrack); SetCurrentAudioTrack(PreferredTrack); } } @@ -882,8 +883,11 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) break; case 0xC0 ... 0xDF: // audio SetAvailableTrack(ttAudio, c - 0xC0, c); - if (!VideoOnly && c == availableTracks[currentAudioTrack].id) + if (!VideoOnly && c == availableTracks[currentAudioTrack].id) { w = PlayAudio(Start, d); + if (FirstLoop) + Audios.PlayAudio(Data, Length, c); + } break; case 0xBD: { // private stream 1 int PayloadOffset = Data[8] + 9; @@ -892,6 +896,7 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) uchar SubStreamIndex = SubStreamId & 0x1F; // Compatibility mode for old VDR recordings, where 0xBD was only AC3: +pre_1_3_19_PrivateStreamDeteced: if (pre_1_3_19_PrivateStream) { SubStreamId = c; SubStreamType = 0x80; @@ -907,15 +912,18 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) SetAvailableTrack(ttDolby, SubStreamIndex, SubStreamId); if (!VideoOnly && SubStreamId == availableTracks[currentAudioTrack].id) { w = PlayAudio(Start, d); - if (FirstLoop && !(SubStreamId & 0x08)) // no DTS - Audios.PlayAudio(Data, Length); + if (FirstLoop) + Audios.PlayAudio(Data, Length, SubStreamId); } } break; case 0xA0: // LPCM SetAvailableTrack(ttAudio, SubStreamIndex, SubStreamId); - if (!VideoOnly && SubStreamId == availableTracks[currentAudioTrack].id) + if (!VideoOnly && SubStreamId == availableTracks[currentAudioTrack].id) { w = PlayAudio(Start, d); + if (FirstLoop) + Audios.PlayAudio(Data, Length, SubStreamId); + } break; default: // Compatibility mode for old VDR recordings, where 0xBD was only AC3: @@ -923,6 +931,7 @@ int cDevice::PlayPesPacket(const uchar *Data, int Length, bool VideoOnly) dsyslog("switching to pre 1.3.19 Dolby Digital compatibility mode"); ClrAvailableTracks(); pre_1_3_19_PrivateStream = true; + goto pre_1_3_19_PrivateStreamDeteced; } } } @@ -984,7 +993,7 @@ int cDevice::PlayPes(const uchar *Data, int Length, bool VideoOnly) int w = PlayPesPacket(Data + i, l, VideoOnly); if (w > 0) i += l; - else if (w < 0) + else return i == 0 ? w : i; } else -- cgit v1.2.3