From 1aadb31fb355550bb415ed971322a9bcb80f9325 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 12 Apr 2009 22:29:35 +0200 Subject: =?UTF-8?q?Version=201.7.5=20-=20Fixed=20a=20hangup=20when=20repla?= =?UTF-8?q?ying=20a=20TS=20recording=20with=20subtitles=20activated=20(rep?= =?UTF-8?q?orted=20=20=20by=20Timo=20Helkio).=20-=20Fixed=20handling=20the?= =?UTF-8?q?=20'new'=20indicator=20in=20the=20recordings=20menu=20for=20TS?= =?UTF-8?q?=20recordings=20=20=20(thanks=20to=20Derek=20Kelly).=20-=20Adde?= =?UTF-8?q?d=20cap=5Fsys=5Fnice=20to=20the=20capabilities=20that=20are=20n?= =?UTF-8?q?ot=20dropped=20(thanks=20to=20Rolf=20=20=20Ahrenberg).=20-=20Up?= =?UTF-8?q?dated=20the=20Italian=20OSD=20texts=20(thanks=20to=20Diego=20Pi?= =?UTF-8?q?erotto).=20-=20Added=20cRecordingInfo::GetEvent()=20(thanks=20t?= =?UTF-8?q?o=20Marcel=20Unbehaun).=20-=20Improved=20synchronizing=20the=20?= =?UTF-8?q?progress=20display,=20trick=20modes=20and=20subtitle=20display?= =?UTF-8?q?=20=20=20to=20the=20actual=20audio/video.=20This=20now=20works?= =?UTF-8?q?=20independent=20of=20any=20buffer=20sizes=20the=20=20=20output?= =?UTF-8?q?=20device=20might=20use.=20=20=20+=20The=20cBackTrace=20class?= =?UTF-8?q?=20has=20been=20replaced=20with=20cPtsIndex,=20which=20keeps=20?= =?UTF-8?q?track=20=20=20=20=20of=20the=20PTS=20timestamps=20of=20recently?= =?UTF-8?q?=20played=20frames.=20=20=20+=20cDevice::GetSTC()=20is=20now=20?= =?UTF-8?q?required=20to=20deliver=20the=20STC=20even=20in=20trick=20modes?= =?UTF-8?q?.=20=20=20=20=20It=20is=20sufficient=20if=20it=20returns=20the?= =?UTF-8?q?=20PTS=20of=20the=20most=20recently=20presented=20=20=20=20=20a?= =?UTF-8?q?udio/video=20frame.=20=20=20+=20The=20full-featured=20DVB=20car?= =?UTF-8?q?ds=20need=20an=20improved=20firmware=20in=20order=20to=20return?= =?UTF-8?q?=20=20=20=20=20proper=20STC=20values=20in=20trick=20modes=20(th?= =?UTF-8?q?anks=20to=20Oliver=20Endriss=20for=20enhancing=20the=20=20=20?= =?UTF-8?q?=20=20av7110=20firmware).=20-=20Adapted=20cFrameDetector::Analy?= =?UTF-8?q?ze()=20to=20HD=20NTSC=20broadcasts=20that=20split=20frames=20ov?= =?UTF-8?q?er=20=20=20several=20payload=20units=20(thanks=20to=20Derek=20K?= =?UTF-8?q?elly=20for=20reporting=20this=20and=20helping=20in=20=20=20test?= =?UTF-8?q?ing).=20-=20Modified=20cFrameDetector::Analyze()=20to=20make=20?= =?UTF-8?q?it=20process=20whole=20frames=20at=20once,=20so=20=20=20that=20?= =?UTF-8?q?file=20I/O=20overhead=20is=20minimized=20during=20recording=20(?= =?UTF-8?q?reported=20by=20G=C3=BCnter=20=20=20Niedermeier).=20-=20Added?= =?UTF-8?q?=20command=20line=20help=20for=20the=20'-i'=20option.=20-=20Fix?= =?UTF-8?q?ed=20cDvbPlayer::NextFile()=20to=20handle=20files=20larger=20th?= =?UTF-8?q?an=202GB=20(thanks=20to=20Jose=20=20=20Alberto=20Reguero).=20-?= =?UTF-8?q?=20Improved=20replay=20at=20the=20begin=20and=20end=20of=20a=20?= =?UTF-8?q?recording.=20The=20very=20first=20and=20very=20last=20=20=20fra?= =?UTF-8?q?me=20is=20now=20sent=20to=20the=20output=20device=20repeatedly?= =?UTF-8?q?=20until=20GetSTC()=20reports=20that=20it=20=20=20has=20been=20?= =?UTF-8?q?played.=20cDvbPlayer::Action()=20no=20longer=20calls=20DeviceFl?= =?UTF-8?q?ush()=20(thanks=20to=20=20=20Reinhard=20Nissl=20for=20making=20?= =?UTF-8?q?sure=20vdr-xine=20no=20longer=20needs=20this).=20-=20Added=20mi?= =?UTF-8?q?ssing=20'[]'=20to=20the=20delete=20operator=20in=20cMenuEditStr?= =?UTF-8?q?Item::~cMenuEditStrItem().=20-=20Added=20missing=20virtual=20de?= =?UTF-8?q?structor=20to=20cPalette.=20-=20Now=20freeing=20configDirectory?= =?UTF-8?q?=20before=20setting=20it=20to=20a=20new=20value=20in=20=20=20cP?= =?UTF-8?q?lugin::SetConfigDirectory().=20-=20Fixed=20a=20crash=20when=20j?= =?UTF-8?q?umping=20to=20an=20editing=20mark=20in=20an=20audio=20recording?= =?UTF-8?q?.=20-=20Fixed=20the=20'VideoOnly'=20condition=20in=20the=20Play?= =?UTF-8?q?Pes()=20and=20PlayTs()=20calls=20in=20=20=20cDvbPlayer::Action(?= =?UTF-8?q?)=20(thanks=20to=20Reinhard=20Nissl).=20-=20cDevice::PlayTs()?= =?UTF-8?q?=20now=20plays=20as=20many=20TS=20packets=20as=20possible=20in?= =?UTF-8?q?=20one=20call.=20-=20Making=20sure=20any=20floating=20point=20n?= =?UTF-8?q?umbers=20written=20use=20a=20decimal=20point=20(thanks=20to=20?= =?UTF-8?q?=20=20Oliver=20Endriss=20for=20pointing=20out=20a=20problem=20w?= =?UTF-8?q?ith=20the=20F=20record=20in=20the=20info=20file=20of=20=20=20a?= =?UTF-8?q?=20recording).=20-=20Fixed=20detecting=20the=20frame=20rate=20f?= =?UTF-8?q?or=20radio=20recordings.=20-=20Added=20missing=20AUDIO=5FPAUSE/?= =?UTF-8?q?AUDIO=5FCONTINUE=20calls=20to=20cDvbDevice=20(thanks=20to=20Oli?= =?UTF-8?q?ver=20=20=20Endriss).=20-=20No=20longer=20writing=20the=20video?= =?UTF-8?q?=20type=20into=20channels.conf=20if=20VPID=20is=200=20(thanks?= =?UTF-8?q?=20to=20=20=20Oliver=20Endriss=20for=20reporting=20this).=20-?= =?UTF-8?q?=20Improved=20efficiency=20of=20cEIT::cEIT()=20(thanks=20to=20T?= =?UTF-8?q?obias=20Bratfisch).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- device.c | 82 +++++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 35 deletions(-) (limited to 'device.c') diff --git a/device.c b/device.c index 1f806e0..ccf176c 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 2.11 2009/01/25 11:10:56 kls Exp $ + * $Id: device.c 2.13 2009/04/05 12:15:41 kls Exp $ */ #include "device.h" @@ -1304,8 +1304,9 @@ int cDevice::PlayTsSubtitle(const uchar *Data, int Length) if (!dvbSubtitleConverter) dvbSubtitleConverter = new cDvbSubtitleConverter; tsToPesSubtitle.PutTs(Data, Length); - if (const uchar *p = tsToPesSubtitle.GetPes(Length)) { - dvbSubtitleConverter->Convert(p, Length); + int l; + if (const uchar *p = tsToPesSubtitle.GetPes(l)) { + dvbSubtitleConverter->Convert(p, l); tsToPesSubtitle.Reset(); } return Length; @@ -1314,43 +1315,54 @@ int cDevice::PlayTsSubtitle(const uchar *Data, int Length) //TODO detect and report continuity errors? int cDevice::PlayTs(const uchar *Data, int Length, bool VideoOnly) { - if (Length == TS_SIZE) { - if (!TsHasPayload(Data)) - return Length; // silently ignore TS packets w/o payload - int PayloadOffset = TsPayloadOffset(Data); - if (PayloadOffset < Length) { - cMutexLock MutexLock(&mutexCurrentAudioTrack); - int Pid = TsPid(Data); - if (Pid == 0) - patPmtParser.ParsePat(Data, Length); - else if (Pid == patPmtParser.PmtPid()) - patPmtParser.ParsePmt(Data, Length); - else if (Pid == patPmtParser.Vpid()) { - isPlayingVideo = true; - return PlayTsVideo(Data, Length); - } - else if (Pid == availableTracks[currentAudioTrack].id) { - if (!VideoOnly || HasIBPTrickSpeed()) { - int w = PlayTsAudio(Data, Length); - if (w > 0) - Audios.PlayTsAudio(Data, Length); - return w; - } - } - else if (Pid == availableTracks[currentSubtitleTrack].id) { - if (!VideoOnly || HasIBPTrickSpeed()) - return PlayTsSubtitle(Data, Length); - } - return Length; - } - } - else if (Data == NULL) { + int Played = 0; + if (Data == NULL) { patPmtParser.Reset(); tsToPesVideo.Reset(); tsToPesAudio.Reset(); tsToPesSubtitle.Reset(); } - return -1; + else { + cMutexLock MutexLock(&mutexCurrentAudioTrack); + while (Length >= TS_SIZE) { + if (TsHasPayload(Data)) { // silently ignore TS packets w/o payload + int PayloadOffset = TsPayloadOffset(Data); + if (PayloadOffset < TS_SIZE) { + int Pid = TsPid(Data); + if (Pid == 0) + patPmtParser.ParsePat(Data, TS_SIZE); + else if (Pid == patPmtParser.PmtPid()) + patPmtParser.ParsePmt(Data, TS_SIZE); + else if (Pid == patPmtParser.Vpid()) { + isPlayingVideo = true; + int w = PlayTsVideo(Data, TS_SIZE); + if (w < 0) + return Played ? Played : w; + if (w == 0) + break; + } + else if (Pid == availableTracks[currentAudioTrack].id) { + if (!VideoOnly || HasIBPTrickSpeed()) { + int w = PlayTsAudio(Data, TS_SIZE); + if (w < 0) + return Played ? Played : w; + if (w == 0) + break; + Audios.PlayTsAudio(Data, TS_SIZE); + } + } + else if (Pid == availableTracks[currentSubtitleTrack].id) { + if (!VideoOnly || HasIBPTrickSpeed()) + PlayTsSubtitle(Data, TS_SIZE); + } + } + } + Played += TS_SIZE; + Length -= TS_SIZE; + Data += TS_SIZE; + } + } + return Played; } int cDevice::Priority(void) const -- cgit v1.2.3