From 5619c0602bc623adeddf3385ada8c742aaea9762 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 13 Mar 2011 12:46:00 +0100 Subject: =?UTF-8?q?Version=201.7.17=20-=20Updated=20the=20Estonian=20OSD?= =?UTF-8?q?=20texts=20(thanks=20to=20Arthur=20Konovalov).=20-=20Fixed=20fo?= =?UTF-8?q?llowing=20symbolic=20links=20in=20RemoveFileOrDir()=20(cont'd)?= =?UTF-8?q?=20(thanks=20to=20=20=20Steffen=20Barszus).=20-=20Changed=20the?= =?UTF-8?q?=20description=20of=20cDevice::GetSTC()=20to=20make=20it=20mand?= =?UTF-8?q?atory=20for=20devices=20=20=20that=20can=20replay.=20-=20Remove?= =?UTF-8?q?d=20the=20check=20for=20positive=20STC=20values=20from=20cDvbSu?= =?UTF-8?q?btitleConverter::Action().=20-=20Added=20cString::operator=3D(c?= =?UTF-8?q?onst=20char=20*String)=20(suggested=20by=20Antti=20Sepp=C3=A4l?= =?UTF-8?q?=C3=A4).=20-=20Some=20spelling=20fixes=20(thanks=20to=20Ville?= =?UTF-8?q?=20Skytt=C3=A4).=20-=20Passing=20package=20name=20and=20version?= =?UTF-8?q?=20to=20xgettext=20(thanks=20to=20Ville=20Skytt=C3=A4).=20-=20M?= =?UTF-8?q?ade=20'dist'=20target=20dependent=20on=20up=20to=20date=20*.po?= =?UTF-8?q?=20(thanks=20to=20Ville=20Skytt=C3=A4).=20-=20Added=20Language?= =?UTF-8?q?=20and=20fixed=20Language-Team=20header=20of=20*.po=20(thanks?= =?UTF-8?q?=20to=20Ville=20Skytt=C3=A4).=20-=20Updated=20the=20Lithuanian?= =?UTF-8?q?=20OSD=20texts=20(thanks=20to=20Valdemaras=20Pipiras).=20-=20Fi?= =?UTF-8?q?xed=20detecting=20frames=20on=20channels=20that=20broadcast=20w?= =?UTF-8?q?ith=2050=20or=2060=20fps.=20=20=20This=20avoids=20artifacts=20d?= =?UTF-8?q?uring=20fast=20forward/rewind=20when=20replaying=20recordings?= =?UTF-8?q?=20from=20such=20=20=20channels.=20To=20fix=20the=20index=20of?= =?UTF-8?q?=20existing=20recordings=20from=20such=20channels,=20just=20del?= =?UTF-8?q?ete=20the=20=20=20'index'=20file=20of=20the=20recording=20and?= =?UTF-8?q?=20VDR=20will=20generate=20a=20new=20one=20the=20next=20time=20?= =?UTF-8?q?you=20play=20it.=20=20=20You=20should=20also=20change=20the=20l?= =?UTF-8?q?ine=20"F=2025"=20to=20"F=2050"=20in=20the=20'info'=20file=20of?= =?UTF-8?q?=20that=20recording.=20-=20Added=20support=20for=20"registratio?= =?UTF-8?q?n=20descriptor"=20to=20'libsi'=20and=20using=20it=20in=20pat.c?= =?UTF-8?q?=20(thanks=20=20=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20unjust?= =?UTF-8?q?ified=20log=20entries=20about=20changed=20channel=20pids=20(rep?= =?UTF-8?q?orted=20by=20Derek=20Kelly).=20-=20Added=20an=20include=20of=20?= =?UTF-8?q?VDR's=20'Make.global'=20to=20libsi's=20Makefile=20(thanks=20to?= =?UTF-8?q?=20Rolf=20=20=20Ahrenberg).=20-=20Removed=20displaying=20the=20?= =?UTF-8?q?"contents"=20information=20from=20the=20"Classic=20VDR"=20and?= =?UTF-8?q?=20=20=20"ST:TNG=20Panels"=20skins,=20because=20it=20is=20often?= =?UTF-8?q?=20wrong=20and=20nothing=20but=20irritating.=20-=20Added=20type?= =?UTF-8?q?casts=20to=20avoid=20gcc=204.5=20warnings=20in=20switch=20state?= =?UTF-8?q?ments=20on=20eKeys=20=20=20variables=20where=20additional=20'k?= =?UTF-8?q?=5F...'=20flags=20are=20used.=20-=20Fixed=20inclusion=20of=20=20(thanks=20to=20Henning=20Heinold).=20-=20Changed=20"?= =?UTF-8?q?frame=20duration"=20to=20"frame=20rate"=20in=20vdr.5=20(reporte?= =?UTF-8?q?d=20by=20Tobias=20Grimm).=20-=20Removing=20a=20cRemote=20from?= =?UTF-8?q?=20the=20Remotes=20list=20in=20case=20its=20initialization=20fa?= =?UTF-8?q?iled=20(thanks=20=20=20to=20Dominik=20Strasser).=20-=20Added=20?= =?UTF-8?q?LDFLAGS=20to=20the=20linker=20calls=20in=20the=20Makefiles=20(t?= =?UTF-8?q?hanks=20to=20Joerg=20Bornkessel=20and=20=20=20Paul=20Menzel).?= =?UTF-8?q?=20-=20Now=20updating=20the=20'frames=20per=20second'=20data=20?= =?UTF-8?q?in=20the=20list=20of=20recordings=20when=20a=20new=20=20=20reco?= =?UTF-8?q?rding=20is=20started=20that=20has=20a=20frame=20rate=20other=20?= =?UTF-8?q?than=20the=20default.=20-=20The=20include=20path=20to=20the=20f?= =?UTF-8?q?reetype2=20header=20files=20is=20now=20retrieved=20via=20a=20ca?= =?UTF-8?q?ll=20to=20=20=20'pkg-config=20--cflags=20freetype2'=20(suggeste?= =?UTF-8?q?d=20by=20Andreas=20Oberritter).=20-=20The=20OSD=20now=20has=20f?= =?UTF-8?q?ull=20TrueColor=20support.=20There=20can=20be=20several=20"pixm?= =?UTF-8?q?aps"=20that=20can=20=20=20be=20overlayed=20with=20alpha=20blend?= =?UTF-8?q?ing.=20All=20existing=20skins=20should=20work=20out=20of=20the?= =?UTF-8?q?=20box=20=20=20with=20the=20TrueColor=20OSD=20-=20the=20only=20?= =?UTF-8?q?exception=20being=20cOsd::GetBitmap().=20Since=20the=20=20=20Tr?= =?UTF-8?q?ueColor=20OSD=20doesn't=20use=20bitmaps,=20this=20function=20wi?= =?UTF-8?q?ll=20return=20a=20dummy=20bitmap,=20which=20=20=20may=20not=20b?= =?UTF-8?q?e=20what=20the=20plugin=20expects.=20As=20long=20as=20this=20bi?= =?UTF-8?q?tmap=20is=20only=20used=20for=20setting=20=20=20the=20palette,?= =?UTF-8?q?=20there=20is=20no=20problem.=20However,=20any=20other=20operat?= =?UTF-8?q?ions=20on=20this=20bitmap=20will=20=20=20have=20no=20effect.=20?= =?UTF-8?q?See=20the=20description=20of=20the=20cPixmap=20functions=20in?= =?UTF-8?q?=20osd.h=20for=20details=20=20=20about=20the=20new=20functional?= =?UTF-8?q?ities.=20=20=20The=20"ST:TNG=20Panels"=20skin=20has=20been=20en?= =?UTF-8?q?hanced=20to=20automatically=20use=20the=20TrueColor=20OSD=20=20?= =?UTF-8?q?=20if=20available.=20=20=20The=20"osddemo"=20plugin=20has=20bee?= =?UTF-8?q?n=20extended=20to=20show=20some=20of=20the=20possibilities=20of?= =?UTF-8?q?=20the=20=20=20TrueColor=20OSD=20if=20it=20is=20run=20on=20a=20?= =?UTF-8?q?system=20that=20actually=20provides=20TrueColor=20support.=20?= =?UTF-8?q?=20=20Thanks=20to=20Reinhard=20Nissl=20for=20some=20valuable=20?= =?UTF-8?q?input,=20help=20with=20debugging,=20and=20an=20=20=20implementa?= =?UTF-8?q?tion=20of=20the=20AlphaBlend()=20function.=20-=20Updated=20the?= =?UTF-8?q?=20Slovakian=20language=20texts=20(thanks=20to=20Milan=20Hrala)?= =?UTF-8?q?.=20-=20Added=20Serbian=20language=20texts=20(thanks=20to=20Mil?= =?UTF-8?q?an=20Cvijanovic).=20-=20Fixed=20reallocating=20memory=20in=20th?= =?UTF-8?q?e=20"pictures"=20plugin=20(reported=20by=20Paul=20Menzel,=20wit?= =?UTF-8?q?h=20=20=20input=20from=20Oliver=20Endriss).=20-=20Fixed=20reall?= =?UTF-8?q?ocating=20memory=20in=20cTsToPes::PutTs()=20(suggested=20by=20O?= =?UTF-8?q?liver=20Endriss).=20-=20Now=20checking=20the=20result=20of=20al?= =?UTF-8?q?l=20realloc()=20calls.=20-=20Fixed=20setting=20up=20the=20'Reco?= =?UTF-8?q?rdings'=20menu=20in=20case=20there=20are=20several=20recordings?= =?UTF-8?q?=20=20=20with=20exactly=20the=20same=20name=20(reported=20by=20?= =?UTF-8?q?Marcus=20Hilbrich).=20-=20Setting=20the=20audio=20type=20of=20l?= =?UTF-8?q?anguage=20descriptors=20to=200x00=20in=20the=20PAT/PMT=20genera?= =?UTF-8?q?tor=20=20=20(thanks=20to=20Anssi=20Hannula).=20-=20Changed=20th?= =?UTF-8?q?e=20compiler=20optimization=20flag=20to=20-O3,=20which=20gives?= =?UTF-8?q?=20quite=20a=20performance=20=20=20boost=20in=20the=20AlphaBlen?= =?UTF-8?q?d()=20function.=20-=20While=20replaying,=20the=20editing=20mark?= =?UTF-8?q?s=20are=20now=20updated=20every=2010=20seconds=20(based=20on=20?= =?UTF-8?q?a=20=20=20patch=20from=20Manuel=20Reimer).=20-=20Now=20reducing?= =?UTF-8?q?=20the=20thread=20and=20I/O=20priority=20cCuttingThread::Action?= =?UTF-8?q?()=20to=20make=20the=20=20=20foreground=20process=20more=20resp?= =?UTF-8?q?onsive=20(suggested=20by=20Frank=20Neumann).=20-=20Removed=20ch?= =?UTF-8?q?ecking=20for=20minimum=20line=20length=20of=2021=20characters?= =?UTF-8?q?=20in=20the=20LIRC=20receiver=20code=20=20=20(reported=20by=20G?= =?UTF-8?q?erald=20Dachs).=20-=20Updated=20the=20Romanian=20OSD=20texts=20?= =?UTF-8?q?(thanks=20to=20Lucian=20Muresan).=20-=20Now=20storing=20the=20o?= =?UTF-8?q?riginal=20display=20size=20when=20handling=20DVB=20subtitles=20?= =?UTF-8?q?(thanks=20to=20=20=20Reinhard=20Nissl).=20-=20The=20original=20?= =?UTF-8?q?display=20size=20of=20subtitles=20is=20now=20used=20to=20scale?= =?UTF-8?q?=20them=20properly=20when=20=20=20displaying=20them=20on=20an?= =?UTF-8?q?=20HD=20OSD.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- remux.c | 59 ++++++++++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 35 deletions(-) (limited to 'remux.c') diff --git a/remux.c b/remux.c index 5206544..f7ad86d 100644 --- a/remux.c +++ b/remux.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: remux.c 2.47 2010/06/05 13:32:15 kls Exp $ + * $Id: remux.c 2.51 2011/02/26 15:51:04 kls Exp $ */ #include "remux.h" @@ -225,7 +225,7 @@ int cPatPmtGenerator::MakeLanguageDescriptor(uchar *Target, const char *Language Target[i++] = *Language++; Target[i++] = *Language++; Target[i++] = *Language++; - Target[i++] = 0x01; // audio type + Target[i++] = 0x00; // audio type Target[Length] += 0x04; // length if (*Language == '+') Language++; @@ -666,9 +666,13 @@ void cTsToPes::PutTs(const uchar *Data, int Length) return; // skip everything before the first payload start Length = TsGetPayload(&Data); if (length + Length > size) { - size = max(KILOBYTE(2), length + Length); - data = (uchar *)realloc(data, size); - if (!data) { + int NewSize = max(KILOBYTE(2), length + Length); + if (uchar *NewData = (uchar *)realloc(data, NewSize)) { + data = NewData; + size = NewSize; + } + else { + esyslog("ERROR: out of memory"); Reset(); return; } @@ -780,9 +784,8 @@ cFrameDetector::cFrameDetector(int Pid, int Type) newFrame = independentFrame = false; numPtsValues = 0; numIFrames = 0; - frameDuration = 0; + framesPerSecond = 0; framesInPayloadUnit = framesPerPayloadUnit = 0; - payloadUnitOfFrame = 0; scanning = false; scanner = EMPTY_SCANNER; } @@ -804,7 +807,6 @@ void cFrameDetector::SetPid(int Pid, int Type) void cFrameDetector::Reset(void) { newFrame = independentFrame = false; - payloadUnitOfFrame = 0; scanning = false; scanner = EMPTY_SCANNER; } @@ -831,8 +833,8 @@ int cFrameDetector::Analyze(const uchar *Data, int Length) return Processed; if (Length < MIN_TS_PACKETS_FOR_FRAME_DETECTOR * TS_SIZE) return Processed; // need more data, in case the frame type is not stored in the first TS packet - if (!frameDuration) { - // frame duration unknown, so collect a sequence of PTS values: + if (!framesPerSecond) { + // frame rate unknown, so collect a sequence of PTS values: if (numPtsValues < MaxPtsValues && numIFrames < 2) { // collect a sequence containing at least two I-frames const uchar *Pes = Data + TsPayloadOffset(Data); if (PesHasPts(Pes)) { @@ -857,28 +859,22 @@ int cFrameDetector::Analyze(const uchar *Data, int Length) uint32_t Delta = ptsValues[0]; // determine frame info: if (isVideo) { - if (Delta % 3600 == 0) - frameDuration = 3600; // PAL, 25 fps, exact timing - else if (abs(Delta % 3600) == 3599 || abs(Delta % 3600) == 1) - frameDuration = 3600; // PAL, 25 fps, timing with jitter + if (abs(Delta - 3600) <= 1) + framesPerSecond = 25.0; else if (Delta % 3003 == 0) - frameDuration = 3003; // NTSC, 29.97 fps - else if (abs(Delta - 1800) <= 1) { - frameDuration = 3600; // PAL, 25 fps - framesPerPayloadUnit = -2; - } - else if (Delta == 1501) { - frameDuration = 3003; // NTSC, 29.97 fps - framesPerPayloadUnit = -2; - } + framesPerSecond = 30.0 / 1.001; + else if (abs(Delta - 1800) <= 1) + framesPerSecond = 50.0; + else if (Delta == 1501) + framesPerSecond = 60.0 / 1.001; else { - frameDuration = 3600; // unknown, assuming 25 fps - dsyslog("unknown frame duration (%d), assuming 25 fps", Delta); + framesPerSecond = 25.0; + dsyslog("unknown frame delta (%d), assuming 25 fps", Delta); } } else // audio - frameDuration = Delta; // PTS of audio frames is always increasing - dbgframes("\nframe duration = %d FPS = %5.2f FPPU = %d\n", frameDuration, 90000.0 / frameDuration, framesPerPayloadUnit); + framesPerSecond = 90000.0 / Delta; // PTS of audio frames is always increasing + dbgframes("\nDelta = %d FPS = %5.2f FPPU = %d\n", Delta, framesPerSecond, framesPerPayloadUnit); } } scanner = EMPTY_SCANNER; @@ -927,13 +923,6 @@ int cFrameDetector::Analyze(const uchar *Data, int Length) newFrame = true; independentFrame = Data[i + 1] == 0x10; if (synced) { - if (framesPerPayloadUnit < 0) { - payloadUnitOfFrame = (payloadUnitOfFrame + 1) % -framesPerPayloadUnit; - if (payloadUnitOfFrame != 0 && independentFrame) - payloadUnitOfFrame = 0; - if (payloadUnitOfFrame) - newFrame = false; - } if (framesPerPayloadUnit <= 1) scanning = false; } @@ -964,7 +953,7 @@ int cFrameDetector::Analyze(const uchar *Data, int Length) pid = 0; // let's just ignore any further data } } - if (!synced && frameDuration && independentFrame) { + if (!synced && framesPerSecond && independentFrame) { synced = true; dbgframes("*"); Reset(); -- cgit v1.2.3