From 99e3c093f404b55683a90e38bbe74e1f51c35316 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Mon, 31 Oct 2005 18:00:00 +0100 Subject: =?UTF-8?q?Version=201.3.35=20-=20Updated=20'sources.conf'=20(than?= =?UTF-8?q?ks=20to=20Philip=20Prindeville).=20-=20Now=20using=20daemon()?= =?UTF-8?q?=20instead=20of=20fork()=20to=20run=20VDR=20in=20daemon=20mode?= =?UTF-8?q?=20(thanks=20to=20=20=20Enrico=20Scholz).=20-=20Fixed=20a=20pos?= =?UTF-8?q?sible=20endless=20loop=20in=20a=20menu=20with=20no=20selectable?= =?UTF-8?q?=20items=20if=20=20=20Setup.MenuScrollWrap=20is=20true=20(thank?= =?UTF-8?q?s=20to=20Enrico=20Scholz).=20-=20Making=20sure=20no=20item=20is?= =?UTF-8?q?=20displayed=20as=20"current"=20if=20Up,=20Down,=20Left=20or=20?= =?UTF-8?q?Right=20is=20=20=20pressed=20in=20a=20menu=20with=20no=20select?= =?UTF-8?q?able=20items.=20-=20Added=20'=5F=5Fattribute=5F=5F'=20to=20func?= =?UTF-8?q?tions=20that=20use=20printf()=20like=20parameters=20(thanks=20?= =?UTF-8?q?=20=20to=20Darren=20Salt).=20-=20Updated=20the=20Finnish=20OSD?= =?UTF-8?q?=20texts=20(thanks=20to=20Rolf=20Ahrenberg).=20-=20Fixed=20a=20?= =?UTF-8?q?leftover=20'summary.vdr'=20in=20vdr.1=20(reported=20by=20Christ?= =?UTF-8?q?oph=20Hermanns).=20-=20Added=20more=20error=20messages=20and=20?= =?UTF-8?q?line=20numbers=20when=20reading=20EPG=20data=20and=20info.vdr?= =?UTF-8?q?=20=20=20(thanks=20to=20Peter=20Bieringer).=20-=20Updated=20the?= =?UTF-8?q?=20Danish=20OSD=20texts=20(thanks=20to=20Mogens=20Elneff).=20-?= =?UTF-8?q?=20Updated=20the=20Estonian=20OSD=20texts=20(thanks=20to=20Arth?= =?UTF-8?q?ur=20Konovalov).=20-=20Added=20missing=20mutex=20locks=20to=20c?= =?UTF-8?q?CiMenu::Abort()=20and=20cCiEnquiry::Abort()=20(reported=20=20?= =?UTF-8?q?=20by=20Marco=20Schl=C3=BC=C3=9Fler).=20-=20Fixed=20lock=20hand?= =?UTF-8?q?ling=20in=20CAM=20communication=20to=20avoid=20problems=20with?= =?UTF-8?q?=20multiple=20CAMs=20=20=20per=20device=20or=20CAMs=20with=20mo?= =?UTF-8?q?re=20than=20one=20smart=20card.=20-=20Updated=20the=20Greek=20O?= =?UTF-8?q?SD=20texts=20(thanks=20to=20Dimitrios=20Dimitrakos).=20-=20Upda?= =?UTF-8?q?ted=20the=20French=20OSD=20texts=20(thanks=20to=20Nicolas=20Hui?= =?UTF-8?q?llard).=20-=20Fixed=20the=20cFilter=20example=20in=20PLUGINS.ht?= =?UTF-8?q?ml=20(reported=20by=20Patrick=20Fischer).=20-=20The=20new=20cla?= =?UTF-8?q?ss=20cUnbufferedFile=20is=20used=20for=20the=20recording=20file?= =?UTF-8?q?s=20to=20avoid=20=20=20trashing=20the=20file=20system=20cache?= =?UTF-8?q?=20(based=20on=20a=20patch=20by=20Ralf=20M=C3=BCller).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dvbplayer.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'dvbplayer.c') diff --git a/dvbplayer.c b/dvbplayer.c index 8f76ab6..fd640d3 100644 --- a/dvbplayer.c +++ b/dvbplayer.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbplayer.c 1.40 2005/08/29 15:43:30 kls Exp $ + * $Id: dvbplayer.c 1.41 2005/10/31 12:33:48 kls Exp $ */ #include "dvbplayer.h" @@ -74,7 +74,7 @@ int cBackTrace::Get(bool Forward) class cNonBlockingFileReader : public cThread { private: - int f; + cUnbufferedFile *f; uchar *buffer; int wanted; int length; @@ -86,14 +86,14 @@ public: cNonBlockingFileReader(void); ~cNonBlockingFileReader(); void Clear(void); - int Read(int FileHandle, uchar *Buffer, int Length); + int Read(cUnbufferedFile *File, uchar *Buffer, int Length); bool Reading(void) { return buffer; } }; cNonBlockingFileReader::cNonBlockingFileReader(void) :cThread("non blocking file reader") { - f = -1; + f = NULL; buffer = NULL; wanted = length = 0; hasData = false; @@ -110,7 +110,7 @@ cNonBlockingFileReader::~cNonBlockingFileReader() void cNonBlockingFileReader::Clear(void) { Lock(); - f = -1; + f = NULL; free(buffer); buffer = NULL; wanted = length = 0; @@ -119,7 +119,7 @@ void cNonBlockingFileReader::Clear(void) newSet.Signal(); } -int cNonBlockingFileReader::Read(int FileHandle, uchar *Buffer, int Length) +int cNonBlockingFileReader::Read(cUnbufferedFile *File, uchar *Buffer, int Length) { if (hasData && buffer) { if (buffer != Buffer) { @@ -131,7 +131,7 @@ int cNonBlockingFileReader::Read(int FileHandle, uchar *Buffer, int Length) return length; } if (!buffer) { - f = FileHandle; + f = File; buffer = Buffer; wanted = Length; length = 0; @@ -146,8 +146,8 @@ void cNonBlockingFileReader::Action(void) { while (Running()) { Lock(); - if (!hasData && f >= 0 && buffer) { - int r = safe_read(f, buffer + length, wanted - length); + if (!hasData && f && buffer) { + int r = f->Read(buffer + length, wanted - length); if (r >= 0) { length += r; if (!r || length == wanted) // r == 0 means EOF @@ -181,7 +181,7 @@ private: cBackTrace *backTrace; cFileName *fileName; cIndexFile *index; - int replayFile; + cUnbufferedFile *replayFile; bool eof; bool firstPacket; ePlayModes playMode; @@ -237,7 +237,7 @@ cDvbPlayer::cDvbPlayer(const char *FileName) isyslog("replay %s", FileName); fileName = new cFileName(FileName, false); replayFile = fileName->Open(); - if (replayFile < 0) + if (!replayFile) return; ringBuffer = new cRingBufferFrame(PLAYERBUFSIZE); // Create the index file: @@ -302,10 +302,10 @@ bool cDvbPlayer::NextFile(uchar FileNumber, int FileOffset) { if (FileNumber > 0) replayFile = fileName->SetOffset(FileNumber, FileOffset); - else if (replayFile >= 0 && eof) + else if (replayFile && eof) replayFile = fileName->NextFile(); eof = false; - return replayFile >= 0; + return replayFile != NULL; } int cDvbPlayer::Resume(void) @@ -342,7 +342,7 @@ bool cDvbPlayer::Save(void) void cDvbPlayer::Activate(bool On) { if (On) { - if (replayFile >= 0) + if (replayFile) Start(); } else @@ -376,7 +376,7 @@ void cDvbPlayer::Action(void) // Read the next frame from the file: if (playMode != pmStill && playMode != pmPause) { - if (!readFrame && (replayFile >= 0 || readIndex >= 0)) { + if (!readFrame && (replayFile || readIndex >= 0)) { if (!nonBlockingFileReader->Reading()) { if (playMode == pmFast || (playMode == pmSlow && playDir == pdBackward)) { uchar FileNumber; -- cgit v1.2.3