summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-10-31 18:00:00 +0100
committerKlaus Schmidinger <kls (at) cadsoft (dot) de>2005-10-31 18:00:00 +0100
commit99e3c093f404b55683a90e38bbe74e1f51c35316 (patch)
treeed19caa03a60230d65a210a213d35bf62ed9f55f
parent88d8d634089bae65bdfea8238a847b7883058072 (diff)
downloadvdr-patch-lnbsharing-99e3c093f404b55683a90e38bbe74e1f51c35316.tar.gz
vdr-patch-lnbsharing-99e3c093f404b55683a90e38bbe74e1f51c35316.tar.bz2
Version 1.3.35vdr-1.3.35
- Updated 'sources.conf' (thanks to Philip Prindeville). - Now using daemon() instead of fork() to run VDR in daemon mode (thanks to Enrico Scholz). - Fixed a possible endless loop in a menu with no selectable items if Setup.MenuScrollWrap is true (thanks to Enrico Scholz). - Making sure no item is displayed as "current" if Up, Down, Left or Right is pressed in a menu with no selectable items. - Added '__attribute__' to functions that use printf() like parameters (thanks to Darren Salt). - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Fixed a leftover 'summary.vdr' in vdr.1 (reported by Christoph Hermanns). - Added more error messages and line numbers when reading EPG data and info.vdr (thanks to Peter Bieringer). - Updated the Danish OSD texts (thanks to Mogens Elneff). - Updated the Estonian OSD texts (thanks to Arthur Konovalov). - Added missing mutex locks to cCiMenu::Abort() and cCiEnquiry::Abort() (reported by Marco Schlüßler). - Fixed lock handling in CAM communication to avoid problems with multiple CAMs per device or CAMs with more than one smart card. - Updated the Greek OSD texts (thanks to Dimitrios Dimitrakos). - Updated the French OSD texts (thanks to Nicolas Huillard). - Fixed the cFilter example in PLUGINS.html (reported by Patrick Fischer). - The new class cUnbufferedFile is used for the recording files to avoid trashing the file system cache (based on a patch by Ralf Müller).
-rw-r--r--CONTRIBUTORS21
-rw-r--r--HISTORY27
-rw-r--r--PLUGINS.html2
-rw-r--r--channels.conf16
-rw-r--r--ci.c47
-rw-r--r--ci.h8
-rw-r--r--config.h6
-rw-r--r--cutter.c12
-rw-r--r--dvbplayer.c30
-rw-r--r--epg.c8
-rw-r--r--i18n.c204
-rw-r--r--menu.c4
-rw-r--r--osdbase.c18
-rw-r--r--recorder.c12
-rw-r--r--recording.c47
-rw-r--r--recording.h12
-rw-r--r--sources.conf15
-rw-r--r--svdrp.h4
-rw-r--r--thread.h4
-rw-r--r--tools.c125
-rw-r--r--tools.h25
-rw-r--r--vdr.14
-rw-r--r--vdr.c10
-rw-r--r--videodir.c21
-rw-r--r--videodir.h6
25 files changed, 454 insertions, 234 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 36f15b7..ab323d2 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -920,6 +920,7 @@ Peter Bieringer <pb@bieringer.de>
for reporting a problem with duplicate recordings with the same file name
for suggesting to implement the command line option '--vfat'
for reporting a leftover 'summary.vdr' in vdr.5
+ for adding more error messages and line numbers when reading EPG data and info.vdr
Alexander Damhuis <ad@phonedation.de>
for reporting problems when deleting a timer that is currently recording
@@ -1024,6 +1025,7 @@ Rene Bartsch <ml@bartschnet.de>
Christoph Hermanns <christoph.hermanns@gmx.de>
for reporting a bug in handling the "Red" button in the "Schedules" menu in case
there are no events listed for a particular channel
+ for reporting a leftover 'summary.vdr' in vdr.1
Oskar Signell <oskar@signell.net>
for pointing out a problem with setting an editing mark while in "Pause" mode,
@@ -1234,6 +1236,7 @@ Marco Schlüßler <marco@lordzodiac.de>
for fixing handling EPG data for time shifted events
for fixing detecting short channel names for "Kabel Deutschland"
for reporting that the FATALERRNO macro needs to check for a non-zero errno value
+ for reporting missing mutex locks in cCiMenu::Abort() and cCiEnquiry::Abort()
Jürgen Schmitz <j.schmitz@web.de>
for reporting a bug in displaying the current channel when switching via the SVDRP
@@ -1343,6 +1346,7 @@ Darren Salt <linux@youmustbejoking.demon.co.uk>
pages
for a patch that was used to add the command line options '--lirc', '--rcu' and
'--no-kbd'
+ for adding '__attribute__' to functions that use printf() like parameters
Sean Carlos <seanc@libero.it>
for translating OSD texts to the Italian language
@@ -1502,3 +1506,20 @@ Alexander Rieger <Alexander.Rieger@inka.de>
for fixing handling color buttons in cMenuEditStrItem
for making the '.update' file in the video directory be touched when a recording is
added or deleted, so that other VDR instances can update their lists
+
+Philip Prindeville <philipp_subx@redfish-solutions.com>
+ for updates to 'sources.conf'
+
+Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+ for making VDR use use daemon() instead of fork() to run in daemon mode
+ for fixing a possible endless loop in a menu with no selectable items if
+ Setup.MenuScrollWrap is true (thanks to Enrico Scholz).
+
+Nicolas Huillard <nhuillard@e-dition.fr>
+ for translating OSD texts to the French language
+
+Patrick Fischer <patrick_fischer@gmx.de>
+ for reporting an error in the cFilter example in PLUGINS.html
+
+Ralf Müller <ralf@bj-ig.de>
+ for a patch that was used to implement cUnbufferedFile
diff --git a/HISTORY b/HISTORY
index 58e8278..6ebe056 100644
--- a/HISTORY
+++ b/HISTORY
@@ -3885,3 +3885,30 @@ Video Disk Recorder Revision History
- The character 0x8A in CAM menu strings is now mapped to a real newline.
- The 'sub-title' and 'bottom text' in the CAM menu can now consist of several lines.
- Improved the CAM enquiry menu.
+
+2005-10-31: Version 1.3.35
+
+- Updated 'sources.conf' (thanks to Philip Prindeville).
+- Now using daemon() instead of fork() to run VDR in daemon mode (thanks to
+ Enrico Scholz).
+- Fixed a possible endless loop in a menu with no selectable items if
+ Setup.MenuScrollWrap is true (thanks to Enrico Scholz).
+- Making sure no item is displayed as "current" if Up, Down, Left or Right is
+ pressed in a menu with no selectable items.
+- Added '__attribute__' to functions that use printf() like parameters (thanks
+ to Darren Salt).
+- Updated the Finnish OSD texts (thanks to Rolf Ahrenberg).
+- Fixed a leftover 'summary.vdr' in vdr.1 (reported by Christoph Hermanns).
+- Added more error messages and line numbers when reading EPG data and info.vdr
+ (thanks to Peter Bieringer).
+- Updated the Danish OSD texts (thanks to Mogens Elneff).
+- Updated the Estonian OSD texts (thanks to Arthur Konovalov).
+- Added missing mutex locks to cCiMenu::Abort() and cCiEnquiry::Abort() (reported
+ by Marco Schlüßler).
+- Fixed lock handling in CAM communication to avoid problems with multiple CAMs
+ per device or CAMs with more than one smart card.
+- Updated the Greek OSD texts (thanks to Dimitrios Dimitrakos).
+- Updated the French OSD texts (thanks to Nicolas Huillard).
+- Fixed the cFilter example in PLUGINS.html (reported by Patrick Fischer).
+- The new class cUnbufferedFile is used for the recording files to avoid
+ trashing the file system cache (based on a patch by Ralf Müller).
diff --git a/PLUGINS.html b/PLUGINS.html
index c44e652..12317cc 100644
--- a/PLUGINS.html
+++ b/PLUGINS.html
@@ -1447,7 +1447,7 @@ An instance of such a filter needs to be attached to the device from
which it shall receive data, as in
<p><table><tr><td bgcolor=#F0F0F0><pre>
-cMyFilter Filter;
+cMyFilter *Filter = new cMyFilter();
cDevice::ActualDevice()-&gt;AttachFilter(Filter);
</pre></td></tr></table><p>
diff --git a/channels.conf b/channels.conf
index c34b8b4..4c6e58b 100644
--- a/channels.conf
+++ b/channels.conf
@@ -8,12 +8,12 @@ hr-fernsehen;ARD:11836:hC34:S19.2E:27500:301:302=deu:304:0:28108:1:1101:0
NDR FS MV;ARD:12109:hC34:S19.2E:27500:2401:2402=deu:2404:0:28224:1:1073:0
SR SÜDWEST Fernsehen;ARD:12265:hC34:S19.2E:27500:1301:1302=deu:1304:0:28486:1:1093:0
WDR Köln;ARD:11836:hC34:S19.2E:27500:601:602=deu:604:0:28111:1:1101:0
-BR-alpha;ARD:11836:hC34:S19.2E:27500:701:702=deu;703:704:0:28112:1:1101:0
+BR-alpha;ARD:11836:hC34:S19.2E:27500:701:702=deu:704:0:28112:1:1101:0
SÜDWEST Ferns. BW;ARD:11836:hC34:S19.2E:27500:801:802=deu:804:0:28113:1:1101:0
Phoenix;ARD:11836:hC34:S19.2E:27500:901:902=deu:904:0:28114:1:1101:0
ZDF;ZDFvision:11953:hC34:S19.2E:27500:110:120=deu,121=2ch;125=dd:130:0:28006:1:1079:0
3sat;ZDFvision:11953:hC34:S19.2E:27500:210:220=deu,221=2ch;225=dd:230:0:28007:1:1079:0
-KiKa;ZDFvision:11953:hC34:S19.2E:27500:310:320:330:0:28008:1:1079:0
+KiKa;ZDFvision:11953:hC34:S19.2E:27500:310:320=deu:330:0:28008:1:1079:0
arte;ARD:11836:hC34:S19.2E:27500:401:402=deu,403=fra:404:0:28109:1:1101:0
ORF1;ORF:12692:hC56:S19.2E:22000:160:161=deu;163=deu:165:1762,D05,1702,1801:13001:1:1117:0
ORF2;ORF:12692:hC56:S19.2E:22000:500:501=deu;503=deu:505:1762,D05,1702,1801:13002:1:1117:0
@@ -27,8 +27,8 @@ NEUN LIVE Television,NEUN LIVE;BetaDigital:12480:vC34:S19.2E:27500:767:768=deu:3
DSF;BetaDigital:12480:vC34:S19.2E:27500:1023:1024=deu:39:0:900:133:33:0
HSE24,HSE24;BetaDigital:12480:vC34:S19.2E:27500:1279:1280=deu:37:0:40:133:33:0
Bloomberg TV Germany;Bloomberg:12551:vC56:S19.2E:22000:162:99=deu:0:0:12160:1:1108:0
-EURONEWS;CSAT:11817:vC34:S19.2E:27500:163:92=fra,93=eng,94=ita,95=esl,98=por,99=deu,91=rus:0:0:8004:1:1070:0
-rbb Brandenburg;ARD:12109:hC34:S19.2E:27500:501:502=deu:504:0:28205:1:1073:0
+EURONEWS;CSAT:11817:vC34:S19.2E:27500:163:92=fra,93=eng,94=ita,95=esl,91=rus,98=por,99=deu:0:0:8004:1:1070:0
+rbb Brandenburg;ARD:12109:hC34:S19.2E:27500:601:602=deu:604:0:28205:1:1073:0
Sky News:11597:vC56:S19.2E:22000:305+131:306=eng:0:0:28707:1:1026:0
Veronica/JETIX;CANALDIGITAAL:12574:hC56:S19.2E:22000:518+8190:92=dut:38:622,100:5020:53:1109:0
BVN;CANALDIGITAAL:12574:hC56:S19.2E:22000:515+8190:96=dut:36:0:5025:53:1109:0
@@ -45,13 +45,13 @@ MDR FERNSEHEN;ARD:12109:hC34:S19.2E:27500:401:402=deu:404:0:28204:1:1073:0
rbb Berlin;ARD:12109:hC34:S19.2E:27500:601:602=deu:604:0:28206:1:1073:0
:Premiere World
PREMIERE START,START;PREMIERE:11797:hC34:S19.2E:27500:255:256=deu:32:1:8:133:2:0
-PREMIERE 1,PREM 1;PREMIERE:11797:hC34:S19.2E:27500:511:512=deu;515=deu:32:1:10:133:2:0
-PREMIERE 2,PREM 2;PREMIERE:11797:hC34:S19.2E:27500:1791:1792=deu;1795=deu:32:1:11:133:2:0
+PREMIERE 1,PREM 1;PREMIERE:11797:hC34:S19.2E:27500:511:512=deu,513=deu;515=deu:32:1:10:133:2:0
+PREMIERE 2,PREM 2;PREMIERE:11797:hC34:S19.2E:27500:1791:1792=deu,1793=deu;1795=deu:32:1:11:133:2:0
PREMIERE 3,PREM 3;PREMIERE:11797:hC34:S19.2E:27500:2303:2304=deu,2305=deu:32:1:43:133:2:0
PREMIERE 4,PREM 4;PREMIERE:11797:hC34:S19.2E:27500:767:768=deu,769=deu:32:1801,1722,1702:9:133:2:0
PREMIERE 5,PREM 5;PREMIERE:11797:hC34:S19.2E:27500:1279:1280=deu,1281=deu:32:1722,1702,1801:29:133:2:0
PREMIERE 6,PREM 6;PREMIERE:11797:hC34:S19.2E:27500:1535:1536=deu:32:1:41:133:2:0
-PREMIERE 7,PREM 7;PREMIERE:11797:hC34:S19.2E:27500:1023:1024=deu:32:1801,1722,1702:20:133:2:0
+PREMIERE 7,PREM 7;PREMIERE:11797:hC34:S19.2E:27500:1023:1024=deu:32:1801,1702,1722:20:133:2:0
DISNEY CHANNEL,DISNEY;PREMIERE:11758:hC34:S19.2E:27500:2559:2560=deu:32:1722,1801,1702:34:133:17:0
:Premiere Direkt
PREMIERE DIREKT,DIREKT;PREMIERE:12031:hC34:S19.2E:27500:2815:2816=deu,2817=deu;2819=deu:0:0:18:133:4:0
@@ -89,7 +89,7 @@ QVC Deutschland;QVC:12551:vC56:S19.2E:22000:165:166:167:0:12100:1:1108:0
TELE 5;BetaDigital:12480:vC34:S19.2E:27500:1535:1536=deu:38:0:51:133:33:0
:@201 Sky
Sky One;BSkyB:12226:hC23:S28.2E:27500:515+8190:643=eng:579:960,961:4705:2:2027:0
-Sky Mix;BSkyB:12226:hC23:S28.2E:27500:514+8190:642=eng,662=NAR:578:960,961:5104:2:2027:0
+Sky Two;BSkyB:12226:hC23:S28.2E:27500:514+8190:642=eng,662=NAR:578:960,961:5104:2:2027:0
ITV2;BSkyB:10758:vC56:S28.2E:22000:2314:2315=eng,2363=NAR:2317:960,961:10070:2:2044:0
Sci-Fi;BSkyB:12148:hC23:S28.2E:27500:512+8190:640=eng:576:960,961:4905:2:2023:0
Paramount;BSkyB:12187:hC23:S28.2E:27500:2313+2304:2326=eng,2327=NAR:2315:960,961:5904:2:2025:0
diff --git a/ci.c b/ci.c
index 9e86c61..4e63fde 100644
--- a/ci.c
+++ b/ci.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ci.c 1.36 2005/10/03 12:58:22 kls Exp $
+ * $Id: ci.c 1.38 2005/10/30 13:04:10 kls Exp $
*/
#include "ci.h"
@@ -156,7 +156,7 @@ public:
uint8_t Status(void);
int Write(int fd);
int Read(int fd);
- void Dump(bool Outgoing);
+ void Dump(int fd, bool Outgoing);
};
cTPDU::cTPDU(uint8_t Slot, uint8_t Tcid, uint8_t Tag, int Length, const uint8_t *Data)
@@ -207,9 +207,9 @@ cTPDU::cTPDU(uint8_t Slot, uint8_t Tcid, uint8_t Tag, int Length, const uint8_t
int cTPDU::Write(int fd)
{
- Dump(true);
+ Dump(fd, true);
if (size)
- return write(fd, data, size) == size ? OK : ERROR;
+ return safe_write(fd, data, size) == size ? OK : ERROR;
esyslog("ERROR: attemp to write TPDU with zero size");
return ERROR;
}
@@ -222,20 +222,20 @@ int cTPDU::Read(int fd)
size = 0;
return ERROR;
}
- Dump(false);
+ Dump(fd, false);
return OK;
}
-void cTPDU::Dump(bool Outgoing)
+void cTPDU::Dump(int fd, bool Outgoing)
{
if (DumpTPDUDataTransfer) {
#define MAX_DUMP 256
- fprintf(stderr, "%s ", Outgoing ? "-->" : "<--");
+ fprintf(stderr, "%2d %s ", fd, Outgoing ? "-->" : "<--");
for (int i = 0; i < size && i < MAX_DUMP; i++)
fprintf(stderr, "%02X ", data[i]);
fprintf(stderr, "%s\n", size >= MAX_DUMP ? "..." : "");
if (!Outgoing) {
- fprintf(stderr, " ");
+ fprintf(stderr, " ");
for (int i = 0; i < size && i < MAX_DUMP; i++)
fprintf(stderr, "%2c ", isprint(data[i]) ? data[i] : '.');
fprintf(stderr, "%s\n", size >= MAX_DUMP ? "..." : "");
@@ -1048,12 +1048,12 @@ cCiMMI::cCiMMI(int SessionId, cCiTransportConnection *Tc)
cCiMMI::~cCiMMI()
{
if (fetchedMenu) {
- cMutexLock MutexLock(&fetchedMenu->mutex);
+ cMutexLock MutexLock(fetchedMenu->mutex);
fetchedMenu->mmi = NULL;
}
delete menu;
if (fetchedEnquiry) {
- cMutexLock MutexLock(&fetchedEnquiry->mutex);
+ cMutexLock MutexLock(fetchedEnquiry->mutex);
fetchedEnquiry->mmi = NULL;
}
delete enquiry;
@@ -1227,7 +1227,7 @@ cCiMenu::cCiMenu(cCiMMI *MMI, bool Selectable)
cCiMenu::~cCiMenu()
{
- cMutexLock MutexLock(&mutex);
+ cMutexLock MutexLock(mutex);
if (mmi)
mmi->Menu(true);
free(titleText);
@@ -1254,7 +1254,8 @@ bool cCiMenu::HasUpdate(void)
bool cCiMenu::Select(int Index)
{
- cMutexLock MutexLock(&mutex);
+ cMutexLock MutexLock(mutex);
+ dbgprotocol("%d: ==> Select %d\n", mmi ? mmi->SessionId() : -1, Index);
if (mmi && -1 <= Index && Index < numEntries)
return mmi->SendMenuAnswer(Index + 1);
return false;
@@ -1267,6 +1268,7 @@ bool cCiMenu::Cancel(void)
bool cCiMenu::Abort(void)
{
+ cMutexLock MutexLock(mutex);
return mmi && mmi->SendCloseMMI();
}
@@ -1282,7 +1284,7 @@ cCiEnquiry::cCiEnquiry(cCiMMI *MMI)
cCiEnquiry::~cCiEnquiry()
{
- cMutexLock MutexLock(&mutex);
+ cMutexLock MutexLock(mutex);
if (mmi)
mmi->Enquiry(true);
free(text);
@@ -1290,7 +1292,7 @@ cCiEnquiry::~cCiEnquiry()
bool cCiEnquiry::Reply(const char *s)
{
- cMutexLock MutexLock(&mutex);
+ cMutexLock MutexLock(mutex);
return mmi ? mmi->SendAnswer(s) : false;
}
@@ -1301,6 +1303,7 @@ bool cCiEnquiry::Cancel(void)
bool cCiEnquiry::Abort(void)
{
+ cMutexLock MutexLock(mutex);
return mmi && mmi->SendCloseMMI();
}
@@ -1617,8 +1620,12 @@ cCiMenu *cCiHandler::GetMenu(void)
cMutexLock MutexLock(&mutex);
for (int Slot = 0; Slot < numSlots; Slot++) {
cCiMMI *mmi = (cCiMMI *)GetSessionByResourceId(RI_MMI, Slot);
- if (mmi)
- return mmi->Menu();
+ if (mmi) {
+ cCiMenu *Menu = mmi->Menu();
+ if (Menu)
+ Menu->mutex = &mutex;
+ return Menu;
+ }
}
return NULL;
}
@@ -1628,8 +1635,12 @@ cCiEnquiry *cCiHandler::GetEnquiry(void)
cMutexLock MutexLock(&mutex);
for (int Slot = 0; Slot < numSlots; Slot++) {
cCiMMI *mmi = (cCiMMI *)GetSessionByResourceId(RI_MMI, Slot);
- if (mmi)
- return mmi->Enquiry();
+ if (mmi) {
+ cCiEnquiry *Enquiry = mmi->Enquiry();
+ if (Enquiry)
+ Enquiry->mutex = &mutex;
+ return Enquiry;
+ }
}
return NULL;
}
diff --git a/ci.h b/ci.h
index 6c35e6f..ae76015 100644
--- a/ci.h
+++ b/ci.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: ci.h 1.17 2005/10/03 12:49:52 kls Exp $
+ * $Id: ci.h 1.18 2005/10/30 12:31:14 kls Exp $
*/
#ifndef __CI_H
@@ -17,11 +17,12 @@
class cCiMMI;
class cCiMenu {
+ friend class cCiHandler;
friend class cCiMMI;
private:
enum { MAX_CIMENU_ENTRIES = 64 }; ///< XXX is there a specified maximum?
cCiMMI *mmi;
- cMutex mutex;
+ cMutex *mutex;
bool selectable;
char *titleText;
char *subTitleText;
@@ -45,10 +46,11 @@ public:
};
class cCiEnquiry {
+ friend class cCiHandler;
friend class cCiMMI;
private:
cCiMMI *mmi;
- cMutex mutex;
+ cMutex *mutex;
char *text;
bool blind;
int expectedLength;
diff --git a/config.h b/config.h
index d33de6a..9b17ad4 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.230 2005/10/01 10:41:33 kls Exp $
+ * $Id: config.h 1.231 2005/10/08 08:48:38 kls Exp $
*/
#ifndef __CONFIG_H
@@ -19,8 +19,8 @@
#include "i18n.h"
#include "tools.h"
-#define VDRVERSION "1.3.34"
-#define VDRVERSNUM 10334 // Version * 10000 + Major * 100 + Minor
+#define VDRVERSION "1.3.35"
+#define VDRVERSNUM 10335 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99
#define MAXLIFETIME 99
diff --git a/cutter.c b/cutter.c
index 9bbb0d4..f656bbd 100644
--- a/cutter.c
+++ b/cutter.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: cutter.c 1.10 2005/08/14 10:51:54 kls Exp $
+ * $Id: cutter.c 1.11 2005/10/31 12:26:44 kls Exp $
*/
#include "cutter.h"
@@ -18,7 +18,7 @@
class cCuttingThread : public cThread {
private:
const char *error;
- int fromFile, toFile;
+ cUnbufferedFile *fromFile, *toFile;
cFileName *fromFileName, *toFileName;
cIndexFile *fromIndex, *toIndex;
cMarks fromMarks, toMarks;
@@ -34,7 +34,7 @@ cCuttingThread::cCuttingThread(const char *FromFileName, const char *ToFileName)
:cThread("video cutting")
{
error = NULL;
- fromFile = toFile = -1;
+ fromFile = toFile = NULL;
fromFileName = toFileName = NULL;
fromIndex = toIndex = NULL;
if (fromMarks.Load(FromFileName) && fromMarks.Count()) {
@@ -64,7 +64,7 @@ void cCuttingThread::Action(void)
if (Mark) {
fromFile = fromFileName->Open();
toFile = toFileName->Open();
- if (fromFile < 0 || toFile < 0)
+ if (!fromFile || !toFile)
return;
int Index = Mark->position;
Mark = fromMarks.Next(Mark);
@@ -92,7 +92,7 @@ void cCuttingThread::Action(void)
fromFile = fromFileName->SetOffset(FileNumber, FileOffset);
CurrentFileNumber = FileNumber;
}
- if (fromFile >= 0) {
+ if (fromFile) {
int len = ReadFrame(fromFile, buffer, Length, sizeof(buffer));
if (len < 0) {
error = "ReadFrame";
@@ -131,7 +131,7 @@ void cCuttingThread::Action(void)
cutIn = false;
}
}
- if (safe_write(toFile, buffer, Length) < 0) {
+ if (toFile->Write(buffer, Length) < 0) {
error = "safe_write";
break;
}
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;
diff --git a/epg.c b/epg.c
index 4377c6d..0bdd185 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.37 2005/09/09 15:14:11 kls Exp $
+ * $Id: epg.c 1.38 2005/10/09 12:57:55 kls Exp $
*/
#include "epg.h"
@@ -285,8 +285,10 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
if (Schedule) {
cEvent *Event = NULL;
char *s;
+ int line = 0;
cReadLine ReadLine;
while ((s = ReadLine.Read(f)) != NULL) {
+ line++;
char *t = skipspace(s + 1);
switch (*s) {
case 'E': if (!Event) {
@@ -316,8 +318,10 @@ bool cEvent::Read(FILE *f, cSchedule *Schedule)
break;
case 'c': // to keep things simple we react on 'c' here
return true;
- default: if (Event && !Event->Parse(s))
+ default: if (Event && !Event->Parse(s)) {
+ esyslog("ERROR: EPG data problem in line %d", line);
return false;
+ }
}
}
esyslog("ERROR: unexpected end of file while reading EPG data");
diff --git a/i18n.c b/i18n.c
index 33f49e1..f21a320 100644
--- a/i18n.c
+++ b/i18n.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: i18n.c 1.213 2005/10/03 12:27:15 kls Exp $
+ * $Id: i18n.c 1.218 2005/10/30 13:37:57 kls Exp $
*
* Translations provided by:
*
@@ -12,7 +12,7 @@
* Italian Alberto Carraro <bertocar@tin.it>, Antonio Ospite <ospite@studenti.unina.it>, Sean Carlos <seanc@libero.it>
* Dutch Arnold Niessen <niessen@iae.nl> <arnold.niessen@philips.com>, Hans Dingemans <hans.dingemans@tacticalops.nl>
* Portuguese Paulo Lopes <pmml@netvita.pt>
- * French Jean-Claude Repetto <jc@repetto.org>, Olivier Jacques <jacquesolivier@hotmail.com>, Gregoire Favre <greg@magma.unil.ch>
+ * French Jean-Claude Repetto <jc@repetto.org>, Olivier Jacques <jacquesolivier@hotmail.com>, Gregoire Favre <greg@magma.unil.ch>, Nicolas Huillard <nhuillard@e-dition.fr>
* Norwegian Jørgen Tvedt <pjtvedt@online.no>, Truls Slevigen <truls@slevigen.no>
* Finnish Hannu Savolainen <hannu@opensound.com>, Jaakko Hyvätti <jaakko@hyvatti.iki.fi>, Niko Tarnanen <niko.tarnanen@hut.fi>, Rolf Ahrenberg <rahrenbe@cc.hut.fi>
* Polish Michael Rakowski <mrak@gmx.de>
@@ -218,7 +218,7 @@ const tI18nPhrase Phrases[] = {
"Timers",
"Programmation",
"Timere",
- "Ajastin",
+ "Ajastimet",
"Timery",
"Timer",
"×ñïíïäéáêüðôçò",
@@ -258,19 +258,19 @@ const tI18nPhrase Phrases[] = {
"",// TODO
"",// TODO
"",// TODO
- "",// TODO
+ "Infos sur l'enregistrement",
"",// TODO
"Tallenteen tiedot",
"",// TODO
"",// TODO
- "",// TODO
+ "ÅããñáöÞ",
"Inspelning",
"Detaliile înregistrãrii",
"",// TODO
"",// TODO
"¸ÝäÞ Þ ×ÐßØáØ",
"",// TODO
- "",// TODO
+ "Salvestuse info",
"Optagelses info",
},
{ "Setup",
@@ -323,7 +323,7 @@ const tI18nPhrase Phrases[] = {
"",// TODO
"Commandes d'enregistrement",
"",// TODO
- "Tallennuskomennot",
+ "Tallennekomennot",
"Rozkazy Nagran",
"Órdenes de grabación",
"ÅíôïëÝò ãéÜ åããñáöÝò",
@@ -426,12 +426,12 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"",//TODO
"",//TODO
- "",//TODO
+ "Info",
"",//TODO
"Tiedot",
"",//TODO
"",//TODO
- "",//TODO
+ "Ðëçñïöïñßåò",
"Info",
"Info",
"",//TODO
@@ -537,7 +537,7 @@ const tI18nPhrase Phrases[] = {
"Uusi",
"Nowy",
"Nuevo",
- "ÍÝï",
+ "NÝï",
"Ny",
"Nou",
"Új",
@@ -910,7 +910,7 @@ const tI18nPhrase Phrases[] = {
"Inserisci",
"Invoegen",
"",// TODO
- "Insért",
+ "Insérer",
"",// TODO
"Lisää",
"Wstawiac",
@@ -975,7 +975,7 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"Réinitialisation",
"",//TODO
- "Alusta",
+ "Nollaa",
"Reset",
"Reiniciar",
"ÅðáíáöïñÜ",
@@ -999,7 +999,7 @@ const tI18nPhrase Phrases[] = {
"Päivitä",
"",//TODO
"",//TODO
- "",//TODO
+ "ÓÜñùóç",
"Skanna",
"Cãutare canale",
"",//TODO
@@ -1081,7 +1081,7 @@ const tI18nPhrase Phrases[] = {
"Timer activo - têm a certeza que quer apagar?",
"Enregistrement en cours - confirmez la suppression",
"Timer gjør opptak - vil du slette likevel?",
- "Ajastettu tallennus käynnissä - keskeytetäänkö?",
+ "Ajastettu tallennus käynnissä - poistetaanko silti?",
"Nagrywanie w trakcie - napewno usunac?",
"¿Timer activo - de verdad eliminarlo?",
"×ñïíïäéáêüðôçò óÝ åîÝëéîç - ÄéáãñáöÞ óßãïõñá?",
@@ -1123,7 +1123,7 @@ const tI18nPhrase Phrases[] = {
"no interface primário",
"sur la carte primaire",
"på første enhet",
- "päävastaanottimella",
+ "ensisijaisella sovittimella",
"na pierwszym interfejsie",
"en interface primario",
"óôÞí êýñéá êÜñôá",
@@ -1231,7 +1231,7 @@ const tI18nPhrase Phrases[] = {
"Tallennus alkaa %d min kuluttua - sammutetaanko?",
"Nagrywanie za %d minut - mimo to wylaczyc?",
"Grabando en %d minutos, ¿de verdad apagar?",
- "ÁíáìÝíåôáé åããñáöÞ óÝ %d ëåðôÜ - ÔåëéêÜ íá ôåñìáôéóôåé?",
+ "ÁíáìÝíåôáé åããñáöÞ óÝ %d ëåðôÜ - ÔåëéêÜ íá ôåñìáôéóôåß?",
"Inspelning startar om %d minuter, vill du avsluta?",
"Înregistrez peste %d minute - închid, totuºi?",
"Felvétel %d perc mulva kezdödik - mégis kikapcsolni?",
@@ -1397,7 +1397,7 @@ const tI18nPhrase Phrases[] = {
"Ppid",
"Ppid",
"Ppid",
- "Aikatieto-PID",
+ "PCR-PID",
"Ppid",
"Ppid",
"Ppid",
@@ -1523,7 +1523,7 @@ const tI18nPhrase Phrases[] = {
"Encriptação",
"Cryptage",
"Kortleser",
- "Salaus",
+ "Salaus (CA)",
"CA",
"CA",
"CA",
@@ -1607,7 +1607,7 @@ const tI18nPhrase Phrases[] = {
"CoderateH",
"CoderateH",
"CoderateH",
- "Yläsuojaustaso",
+ "Suojaustaso (HP)",
"CoderateH",
"CoderateH",
"CoderateH",
@@ -1628,7 +1628,7 @@ const tI18nPhrase Phrases[] = {
"CoderateL",
"CoderateL",
"CoderateL",
- "Alasuojaustaso",
+ "Suojaustaso (LP)",
"CoderateL",
"CoderateL",
"CoderateL",
@@ -1670,7 +1670,7 @@ const tI18nPhrase Phrases[] = {
"Transmission",
"Transmission",
"Transmission",
- "Lähetystila",
+ "Transmissio",
"Transmisja",
"Transmission",
"Transmission",
@@ -1715,7 +1715,7 @@ const tI18nPhrase Phrases[] = {
"Hierarkia",
"Hierachia",
"Hierarchy",
- "Hierarchy",
+ "Éåñáñ÷åßá",
"Hierarchy",
"Ierarhie",
"Hierarchy",
@@ -1842,7 +1842,7 @@ const tI18nPhrase Phrases[] = {
"VPS",
"",// TODO
"",// TODO
- "",// TODO
+ "VPS",
"VPS",
"VPS",
"",// TODO
@@ -2071,7 +2071,7 @@ const tI18nPhrase Phrases[] = {
"Nenhuma placa DVB disponivel para gravar!",
"Pas de carte DVB disponible pour l'enregistrement!",
"Ingen ledige DVB enheter for opptak!",
- "Ei vapaata vastaanotinta tallennukselle!",
+ "Ei vapaata DVB-viritintä tallennukselle!",
"Brak wolnej karty DVB do nagrywania!",
"¡No hay dispositivo DVB disponible para grabar!",
"ÁíåðÜñêåéá DVB ÊÜñôáò ãéÜ åããñáöÞ!",
@@ -2281,18 +2281,18 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"",//TODO
"",//TODO
+ "Avataan CA-moduulin valikkoa...",
"",//TODO
"",//TODO
"",//TODO
+ "Åßóïäïò CAM Ìåíïý",
"",//TODO
"",//TODO
"",//TODO
"",//TODO
"",//TODO
- "",//TODO
- "",//TODO
- "",//TODO
- "",//TODO
+ "CAM-menüü avamine...",
+ "Åbner CAM menu...",
},
{ "Can't open CAM menu!",
"CAM-Menü kann nicht geöffnet werden!",
@@ -2302,7 +2302,7 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"Impossible d'ouvrir le menu CAM!",
"",//TODO
- "Salausmoduulin valikko ei saatavilla",
+ "CA-moduulin valikko ei saatavilla",
"CAM-Menu niedostepne!",
"¡No pudeo acceder al menú de la CAM!",
"Áäýíáôç ç ðñüóâáóç óôü CAM ìåíïý!",
@@ -2323,18 +2323,18 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"",//TODO
"",//TODO
+ "CA-moduuli palautetaan alkutilaan...",
"",//TODO
"",//TODO
"",//TODO
+ "ÅðáíáöïñÜ CAM",
"",//TODO
"",//TODO
"",//TODO
"",//TODO
"",//TODO
- "",//TODO
- "",//TODO
- "",//TODO
- "",//TODO
+ "CAM mooduli taaskäivitus...",
+ "Nulstiller CAM...",
},
{ "Can't reset CAM!",
"CAM-Reset fehlgeschlagen!",
@@ -2344,7 +2344,7 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"Impossible de réinitialiser la CAM!",
"",//TODO
- "Salausmoduulin alustus epäonnistui!",
+ "CA-moduulin palautus alkutilaan epäonnistui!",
"Nieudany CAM-Reset!",
"¡No puedo reiniciar la CAM!",
"Áäýíáôï íá ãßíåé åðáíáöïñÜ óôü CAM",
@@ -2365,7 +2365,7 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"La CAM a été réinitialisée",
"",//TODO
- "Salausmoduuli alustettu",
+ "CA-moduuli palautettu alkutilaan",
"CAM-Reset wykonany",
"CAM reiniciada",
"Óôï CAM Ýãéíå åðáíáöïñÜ",
@@ -2386,18 +2386,18 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"",//TODO
"",//TODO
+ "Syötä %d numeroa!",
"",//TODO
"",//TODO
"",//TODO
+ "Ðáñáêáëü ðëçêôñïëïãÞóåôå %d íïýìåñá",
"",//TODO
"",//TODO
"",//TODO
"",//TODO
"",//TODO
- "",//TODO
- "",//TODO
- "",//TODO
- "",//TODO
+ "Palun sisesta %d numbrit!",
+ "Indtast venligst %d cifre!",
},
{ "No audio available!",
"Kein Audio verfügbar!",
@@ -2410,7 +2410,7 @@ const tI18nPhrase Phrases[] = {
"Äänen kieli ei ole valittavissa!",
"",//TODO
"",//TODO
- "",//TODO
+ "ÁíåðÜñêåéá Þ÷ïõ",
"Ljud saknas!"
"Lipseºte sunetul!",
"",//TODO
@@ -2513,7 +2513,7 @@ const tI18nPhrase Phrases[] = {
"CICAM",
"Accès conditionnel",
"CICAM",
- "CI-moduuli",
+ "CICAM",
"CICAM",
"CICAM",
"CICAM",
@@ -2685,7 +2685,7 @@ const tI18nPhrase Phrases[] = {
"Ulkoasu",
"",// TODO
"",// TODO
- "",// TODO
+ "ÅðéöÜíåéá",
"Skin",
"Skin",
"",// TODO
@@ -2706,7 +2706,7 @@ const tI18nPhrase Phrases[] = {
"Teema",
"",// TODO
"",// TODO
- "",// TODO
+ "ÈÝìá",
"Tema",
"Temã",
"",// TODO
@@ -2727,7 +2727,7 @@ const tI18nPhrase Phrases[] = {
"Vaakakeskitys",
"",// TODO
"",// TODO
- "",// TODO
+ "ÁñéóôåñÜ",
"Vänster",
"Stânga",
"",// TODO
@@ -2748,7 +2748,7 @@ const tI18nPhrase Phrases[] = {
"Pystykeskitys",
"",// TODO
"",// TODO
- "",// TODO
+ "ÅðÜíù",
"Övre",
"Sus",
"",// TODO
@@ -2832,7 +2832,7 @@ const tI18nPhrase Phrases[] = {
"Käytä pieniä kirjasimia",
"",// TODO
"",// TODO
- "",// TODO
+ "×ñéóçìïðïßçóç ìéêñüí ãñáììáôïóåéñþí",
"Använd liten font",
"Utilizare fonturi mici",
"",// TODO
@@ -2853,7 +2853,7 @@ const tI18nPhrase Phrases[] = {
"ei koskaan",
"",// TODO
"",// TODO
- "",// TODO
+ "ÐïôÝ"
"aldrig",
"niciodatã",
"",// TODO
@@ -2869,12 +2869,12 @@ const tI18nPhrase Phrases[] = {
"in base alla superficie",
"skin afhankelijk",
"",// TODO
- "Dépend du skin",
+ "dépend du skin",
"",// TODO
"ulkoasun mukaan",
"",// TODO
"",// TODO
- "",// TODO
+ "ÅîáñôÜôå áðü ôÞí åðéöÜíåéá",
"skin beroende",
"dep. de skin",
"",// TODO
@@ -2895,7 +2895,7 @@ const tI18nPhrase Phrases[] = {
"aina",
"",// TODO
"",// TODO
- "",// TODO
+ "ðÜíôá",
"alltid",
"întotdeauna",
"",// TODO
@@ -2937,7 +2937,7 @@ const tI18nPhrase Phrases[] = {
"Kanavatiedon esitysaika (s)",
"",// TODO
"",// TODO
- "",// TODO
+ "÷ñüíïò Ýíäåéêóçò ðëçñïöïñßùí êáíáëéïý óå (ä)",
"Kanal information (s)",
"Durata afiºãrii info-canal (s)",
"",// TODO
@@ -2974,7 +2974,7 @@ const tI18nPhrase Phrases[] = {
"Scorri pagina nel menu",
"Scrollen per pagina",
"Scroll da página no menu",
- "Scrolling par pages",
+ "Défilement par pages",
"Rask rulling i menyer",
"Valikoiden vieritys sivuttain",
"Przesuwac stronami",
@@ -2995,12 +2995,12 @@ const tI18nPhrase Phrases[] = {
"",// TODO
"",// TODO
"",// TODO
- "",// TODO
+ "Défilement rotatif",
"",// TODO
"Valikoiden vieritys ympäri",
"",// TODO
"",// TODO
- "",// TODO
+ "Êßëéóç ãýñù-ãýñù",
"Rulla texten",
"Derulare circularã",
"",// TODO
@@ -3039,7 +3039,7 @@ const tI18nPhrase Phrases[] = {
"Directorias de gravação",
"Dossiers d'enregistrements",
"Kataloger til opptak",
- "Tallennehakemistot",
+ "Näytä tallennehakemistot",
"Wykaz nagran",
"Gracaciones en directorios",
"ÖÜêåëïé åããñáöþí",
@@ -3100,12 +3100,12 @@ const tI18nPhrase Phrases[] = {
"Visualizzazione dati vecchi (min)",
"Oude EPG data tonen (min)",
"",// TODO
- "Montrer l'EPG plus vieux de m min",
+ "Montrer l'EPG périmé (min)",
"",// TODO
"Vanha tieto näkyy (min)",
"",// TODO
"",// TODO
- "",// TODO
+ "¸íäåéêóç îåðåñáóìÝíïí ðëçñïöïñéþí (ëåðôÜ)",
"Visa gammal information (min)",
"Date EPG expirate cel mult (min)",
"",// TODO
@@ -3123,7 +3123,7 @@ const tI18nPhrase Phrases[] = {
"Ajustar relógio do sistema",
"Ajuster l'heure du système",
"Juster system-klokken",
- "Aseta kellonaika",
+ "Tahdista kellonaika",
"Ustawianie czasu",
"Ajustar reloj de sistema",
"Óõíôïíéóìüò þñáò õðïëïãéóôÞ",
@@ -3168,7 +3168,7 @@ const tI18nPhrase Phrases[] = {
"Suosikkikielet",
"",// TODO
"",// TODO
- "",// TODO
+ "Ðñïôéíüìåíåò ãëþóåò",
"Önskade språk",
"Limbi preferate",
"",// TODO
@@ -3189,7 +3189,7 @@ const tI18nPhrase Phrases[] = {
"Suosikkikieli",
"",// TODO
"",// TODO
- "",// TODO
+ "Ðñïôéíüìåíç ãëþóá",
"Önskat språk",
"Limba preferatã",
"",// TODO
@@ -3207,7 +3207,7 @@ const tI18nPhrase Phrases[] = {
"Interface DVB primário",
"Carte DVB primaire",
"Hoved DVB-enhet",
- "Päävastaanotin",
+ "Ensisijainen DVB-sovitin",
"Pierwotny interfejs DVB",
"Primer interface DVB",
"Êýñéá DVB êÜñôá",
@@ -3226,12 +3226,12 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"Video display format",
"",//TODO
- "",//TODO
+ "Format d'affichage",
"",//TODO
"Näyttömuoto",
"",//TODO
"",//TODO
- "",//TODO
+ "ÌïñöÞ Ýíäåéêóçò Âßíôåï",
"Format för video display",
"Formatul redãrii video",
"",//TODO
@@ -3315,7 +3315,7 @@ const tI18nPhrase Phrases[] = {
"Kuvasuhde",
"Format telewizyjny",
"Formato Vídeo",
- "Ó÷Þìá ïèüíçò",
+ "ÌïñöÞ ïèüíçò",
"Video format",
"Format video",
"Video formátum",
@@ -3336,7 +3336,7 @@ const tI18nPhrase Phrases[] = {
"Käytä Dolby Digital -ääntä",
"",//TODO
"",//TODO
- "",//TODO
+ "×ñçóéìïðïßçóç Þ÷ïõ Dolby Digital",
"Använd Dolby Digital",
"Sunet Dolby Digital",
"",//TODO
@@ -3357,7 +3357,7 @@ const tI18nPhrase Phrases[] = {
"Päivitä kanavat",
"",// TODO
"",// TODO
- "",// TODO
+ "áíáíÝïóç êáíáëéþí",
"Uppdatera kanaler",
"Actualizare canale",
"",// TODO
@@ -3373,12 +3373,12 @@ const tI18nPhrase Phrases[] = {
"solo nomi",
"alleen namen",
"",// TODO
- "Seulement les noms",
+ "noms uniquement",
"",// TODO
"vain nimet",
"",// TODO
"",// TODO
- "",// TODO
+ "ìüíï üíïìá",
"bara namn",
"doar numele",
"",// TODO
@@ -3394,12 +3394,12 @@ const tI18nPhrase Phrases[] = {
"nomi e PIDs",
"namen en PIDs",
"",// TODO
- "Noms et PIDs",
+ "noms et PIDs",
"",// TODO
"nimet ja PID:it",
"",// TODO
"",// TODO
- "",// TODO
+ "üíïìá êáß PID",
"namn och PID",
"nume si PID-uri",
"",// TODO
@@ -3415,12 +3415,12 @@ const tI18nPhrase Phrases[] = {
"aggiungere canali nuovi",
"nieuwe kanalen toevoegen",
"",// TODO
- "Ajouter les nouvelles chaînes",
- "",// TODO
- "lisää uudet kanavat",
+ "ajouter chaînes",
"",// TODO
+ "uudet kanavat",
"",// TODO
"",// TODO
+ "ðñïóèÞêç íÝïí êáíáëéþí",
"lägg till nya kanaler",
"adãugare canale noi",
"",// TODO
@@ -3436,12 +3436,12 @@ const tI18nPhrase Phrases[] = {
"aggiungere transponder nuovi",
"nieuwe transponders toevoegen",
"",// TODO
- "Ajouter les nouveaux transpondeurs",
- "",// TODO
- "lisää uudet transponderit",
+ "ajouter transpondeurs",
"",// TODO
+ "uudet transponderit",
"",// TODO
"",// TODO
+ "ðñïóèÞêç íÝïí transponder",
"lägg till nya transponders",
"adãugare transpondere noi",
"",// TODO
@@ -3457,12 +3457,12 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"Audio talen",
"",//TODO
- "",//TODO
+ "Langues audio",
"",//TODO
"Äänen kielet",
"",//TODO
"",//TODO
- "",//TODO
+ "Ãëþóåò Þ÷ïõ",
"Antal ljudspråk",
"Limbi sunet",
"",//TODO
@@ -3478,12 +3478,12 @@ const tI18nPhrase Phrases[] = {
"",//TODO
"Audio taal",
"",//TODO
- "",//TODO
+ "Langue audio",
"",//TODO
"Äänen kieli",
"",//TODO
"",//TODO
- "",//TODO
+ "Ãëþóá Þ÷ïõ",
"Ljudspråk",
"Limba sunetului",
"",//TODO
@@ -3501,7 +3501,7 @@ const tI18nPhrase Phrases[] = {
"Limite de bandas LNB (MHz)",
"Limite de bandes LNB (MHz)",
"LO-grensefrekvens (MHz)",
- "LNB rajataajuus (MHz)",
+ "LNB-rajataajuus (MHz)",
"SLOF (MHz)",
"SLOF (MHz)",
"SLOF (MHz)",
@@ -3522,7 +3522,7 @@ const tI18nPhrase Phrases[] = {
"Frequência base LNB (MHz)",
"Fréquence basse LNB (MHz)",
"LO-frekvens i lavbåndet (MHz)",
- "LNB alempi taajuus (MHz)",
+ "LNB-alataajuus (MHz)",
"Dolna czestotliwosc LNB (MHz)",
"Frecuencia baja LNB (MHz)",
"ÊÜôù LNB-Óõ÷íüôçôá (MHz)",
@@ -3543,7 +3543,7 @@ const tI18nPhrase Phrases[] = {
"Frequência alta LNB (MHz)",
"Fréquence haute LNB (MHz)",
"LO-frekvens i høybåndet (MHz)",
- "LNB ylempi taajuus (MHz)",
+ "LNB-ylätaajuus (MHz)",
"Gorna czestotliwosc LNB (MHz)",
"Frecuencia alta LNB (MHz)",
"¢íù LNB-Óõ÷íüôçôá (MHz)",
@@ -3564,7 +3564,7 @@ const tI18nPhrase Phrases[] = {
"Utilizar DiSEqC",
"Utiliser le DiSEqC",
"Bruk DiSEqC",
- "DiSEqC käytössä",
+ "Käytä DiSEqC-kytkintä",
"Uzywac DiSEqC",
"Utilizar DiSEqC",
"Åíåñãïðïßçóç DiSEqC",
@@ -3585,7 +3585,7 @@ const tI18nPhrase Phrases[] = {
"CICAM DVB",
"Accès conditionnel",
"CICAM DVB",
- "CI-moduuli DVB",
+ "CICAM DVB",
"CICAM DVB",
"CICAM DVB",
"CICAM DVB",
@@ -3648,7 +3648,7 @@ const tI18nPhrase Phrases[] = {
"Limite Primário",
"Limite primaire",
"Prioritetsgrense HovedDVB",
- "Päävastaanottimen prioriteetti",
+ "Ensisijaisen sovittimen prioriteettiraja",
"Pierwotny limit",
"Límite primario",
"Ðñïôåýïí üñéï",
@@ -3777,7 +3777,7 @@ const tI18nPhrase Phrases[] = {
"Käytä VPS-toimintoa",
"",// TODO
"",// TODO
- "",// TODO
+ "×ñÞóç VPS",
"Använd VPS",
"Utilizeazã VPS",
"",// TODO
@@ -3798,7 +3798,7 @@ const tI18nPhrase Phrases[] = {
"VPS-toiminnon aloitusmarginaali (s)",
"",// TODO
"",// TODO
- "",// TODO
+ "Ðåñéèüñéï VPS (ä)",
"VPS marginal (s)",
"Marjã de timp la utilizare VPS (s)",
"",// TODO
@@ -3921,7 +3921,7 @@ const tI18nPhrase Phrases[] = {
"Modo de multi-speed",
"Mode multi-vitesses",
"Multispeed modus",
- "Moninopeustila",
+ "Käytä toiston moninopeustilaa",
"Tryb wielopredkosciowy",
"Modo multi-velocidad",
"Ìåèïäïò ðïëëáðëÞò ôá÷ýôçôáò",
@@ -4026,7 +4026,7 @@ const tI18nPhrase Phrases[] = {
"Timeout SVDRP (s)",
"Temps maxi SVDRP (s)",
"Ubrukt SVDRP-levetid (s)",
- "SVDRP odotusaika (s)",
+ "SVDRP-komennon odotusaika (s)",
"Min. brak aktywnosci SVDRP (s)",
"SVDRP Timeout (s)",
"SVDRP äéáêïðÞ (ä)",
@@ -4045,7 +4045,7 @@ const tI18nPhrase Phrases[] = {
"Timeout Zapping",
"Zap timeout (s)",
"",// TODO
- "Prise en compte dernière chaîne (s)",
+ "Prise en compte chaîne (s)",
"",// TODO
"Kanavavalinnan odotusaika (s)",
"",// TODO
@@ -4915,7 +4915,7 @@ const tI18nPhrase Phrases[] = {
"Ääni",
"",// TODO
"",// TODO
- "",// TODO
+ "¹÷ïò",
"Ljud",
"Sunet",
"",// TODO
@@ -5228,7 +5228,7 @@ const tI18nPhrase Phrases[] = {
"A mudar interface DVB primário...",
"Changement de carte DVB primaire...",
"Bytter første DVB-enhet...",
- "Vaihdetaan päävastaanottimelle...",
+ "Vaihdetaan ensisijaista DVB-sovitinta...",
"Pierwszy interfejs DVB przelacza...",
"Cambio al interface DVB primario...",
"Ç êýñéá DVB êÜñôá áëëÜæåé...",
@@ -5373,12 +5373,12 @@ const tI18nPhrase Phrases[] = {
"",// TODO
"",// TODO
"",// TODO
- "",// TODO
+ "Mise à jour du guide des programmes",
"",// TODO
"Ohjelmaoppaan päivitys aloitettu",
"",// TODO
"",// TODO
- "",// TODO
+ "Áñ÷Þ óÜñùóç EPG",
"Påbörjar EPG skanning",
"Pornesc achiziþia EPG",
"",// TODO
@@ -5415,12 +5415,12 @@ const tI18nPhrase Phrases[] = {
"VDR Classico",
"VDR Klassiek",
"",// TODO
- "",// TODO
+ "VDR Classique",// TODO
"",// TODO
"Klassinen VDR",
"",// TODO
"",// TODO
- "",// TODO
+ "Êëáóéêü VDR",
"Klassisk VDR",
"VDR clasic",
"",// TODO
@@ -5436,12 +5436,12 @@ const tI18nPhrase Phrases[] = {
"Consolles ST:TNG",
"ST:TNG Consoles",
"",// TODO
- "",// TODO
+ "Consoles ST:TNG",
"",// TODO
"ST:TNG konsoli",
"",// TODO
"",// TODO
- "",// TODO
+ "ÌïñöÝò ST:TNG",
"ST:TNG konsoll",
"Cons. ST:TNG",
"",// TODO
@@ -5457,19 +5457,19 @@ const tI18nPhrase Phrases[] = {
"",// TODO
"",// TODO
"",// TODO
- "",// TODO
+ "Sans titre",
"",// TODO
"Ei esitystä",
"",// TODO
"",// TODO
- "",// TODO
+ "Ï÷é ôßôëï",
"ingen titel",
"Fãrã titlu",
"",// TODO
"",// TODO
"±Õ× ÝÐ×ÒÐÝØï",
"Bez titla",
- "",// TODO
+ "Pealkiri puudub",
"Ingen titel",
},
{ NULL }
diff --git a/menu.c b/menu.c
index 19079be..c280b45 100644
--- a/menu.c
+++ b/menu.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: menu.c 1.374 2005/10/03 12:53:51 kls Exp $
+ * $Id: menu.c 1.375 2005/10/09 11:22:03 kls Exp $
*/
#include "menu.h"
@@ -230,7 +230,7 @@ public:
};
cMenuEditChannel::cMenuEditChannel(cChannel *Channel, bool New)
-:cOsdMenu(tr("Edit channel"), 14)
+:cOsdMenu(tr("Edit channel"), 16)
{
channel = Channel;
if (channel) {
diff --git a/osdbase.c b/osdbase.c
index 9646bcc..e99c986 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 1.22 2005/10/02 15:00:40 kls Exp $
+ * $Id: osdbase.c 1.24 2005/10/09 10:56:26 kls Exp $
*/
#include "osdbase.h"
@@ -242,8 +242,8 @@ void cOsdMenu::DisplayCurrent(bool Current)
{
cOsdItem *item = Get(current);
if (item) {
- displayMenu->SetItem(item->Text(), current - first, Current, item->Selectable());
- if (Current)
+ displayMenu->SetItem(item->Text(), current - first, Current && item->Selectable(), item->Selectable());
+ if (Current && item->Selectable())
cStatus::MsgOsdCurrentItem(item->Text());
if (!Current)
item->SetFresh(true); // leaving the current item resets 'fresh'
@@ -268,14 +268,16 @@ void cOsdMenu::CursorUp(void)
int tmpCurrent = current;
int lastOnScreen = first + displayMenuItems - 1;
int last = Count() - 1;
+ if (last < 0)
+ return;
while (--tmpCurrent != current) {
if (tmpCurrent < 0) {
if (Setup.MenuScrollWrap)
- tmpCurrent = last;
+ tmpCurrent = last + 1;
else
return;
}
- if (SelectableItem(tmpCurrent))
+ else if (SelectableItem(tmpCurrent))
break;
}
if (first <= tmpCurrent && tmpCurrent <= lastOnScreen)
@@ -298,14 +300,16 @@ void cOsdMenu::CursorDown(void)
int tmpCurrent = current;
int lastOnScreen = first + displayMenuItems - 1;
int last = Count() - 1;
+ if (last < 0)
+ return;
while (++tmpCurrent != current) {
if (tmpCurrent > last) {
if (Setup.MenuScrollWrap)
- tmpCurrent = 0;
+ tmpCurrent = -1;
else
return;
}
- if (SelectableItem(tmpCurrent))
+ else if (SelectableItem(tmpCurrent))
break;
}
if (first <= tmpCurrent && tmpCurrent <= lastOnScreen)
diff --git a/recorder.c b/recorder.c
index 34236fc..35a8e56 100644
--- a/recorder.c
+++ b/recorder.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recorder.c 1.15 2005/08/14 10:53:28 kls Exp $
+ * $Id: recorder.c 1.16 2005/10/31 12:35:29 kls Exp $
*/
#include <stdarg.h>
@@ -28,7 +28,7 @@ private:
cIndexFile *index;
uchar pictureType;
int fileSize;
- int recordFile;
+ cUnbufferedFile *recordFile;
time_t lastDiskSpaceCheck;
bool RunningLowOnDiskSpace(void);
bool NextFile(void);
@@ -50,7 +50,7 @@ cFileWriter::cFileWriter(const char *FileName, cRemux *Remux)
lastDiskSpaceCheck = time(NULL);
fileName = new cFileName(FileName, true);
recordFile = fileName->Open();
- if (recordFile < 0)
+ if (!recordFile)
return;
// Create the index file:
index = new cIndexFile(FileName, true);
@@ -81,13 +81,13 @@ bool cFileWriter::RunningLowOnDiskSpace(void)
bool cFileWriter::NextFile(void)
{
- if (recordFile >= 0 && pictureType == I_FRAME) { // every file shall start with an I_FRAME
+ if (recordFile && pictureType == I_FRAME) { // every file shall start with an I_FRAME
if (fileSize > MEGABYTE(Setup.MaxVideoFileSize) || RunningLowOnDiskSpace()) {
recordFile = fileName->NextFile();
fileSize = 0;
}
}
- return recordFile >= 0;
+ return recordFile != NULL;
}
void cFileWriter::Action(void)
@@ -102,7 +102,7 @@ void cFileWriter::Action(void)
if (NextFile()) {
if (index && pictureType != NO_PICTURE)
index->Write(pictureType, fileName->Number(), fileSize);
- if (safe_write(recordFile, p, Count) < 0) {
+ if (recordFile->Write(p, Count) < 0) {
LOG_ERROR_STR(fileName->Name());
break;
}
diff --git a/recording.c b/recording.c
index 9e96922..c90e54d 100644
--- a/recording.c
+++ b/recording.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.c 1.120 2005/10/01 10:29:02 kls Exp $
+ * $Id: recording.c 1.122 2005/10/31 12:27:58 kls Exp $
*/
#include "recording.h"
@@ -264,7 +264,9 @@ bool cRecordingInfo::Read(FILE *f)
if (ownEvent) {
cReadLine ReadLine;
char *s;
+ int line = 0;
while ((s = ReadLine.Read(f)) != NULL) {
+ ++line;
char *t = skipspace(s + 1);
switch (*s) {
case 'C': {
@@ -275,8 +277,10 @@ bool cRecordingInfo::Read(FILE *f)
channelID = tChannelID::FromString(t);
}
break;
- default: if (!ownEvent->Parse(s))
+ default: if (!ownEvent->Parse(s)) {
+ esyslog("ERROR: EPG data problem in line %d", line);
return false;
+ }
break;
}
}
@@ -478,7 +482,8 @@ cRecording::cRecording(const char *FileName)
asprintf(&InfoFileName, "%s%s", fileName, INFOFILESUFFIX);
FILE *f = fopen(InfoFileName, "r");
if (f) {
- info->Read(f);
+ if (!info->Read(f))
+ esyslog("ERROR: EPG data problem in file %s", InfoFileName);
fclose(f);
}
else if (errno != ENOENT)
@@ -1253,7 +1258,7 @@ int cIndexFile::Get(uchar FileNumber, int FileOffset)
cFileName::cFileName(const char *FileName, bool Record, bool Blocking)
{
- file = -1;
+ file = NULL;
fileNumber = 0;
record = Record;
blocking = Blocking;
@@ -1274,21 +1279,21 @@ cFileName::~cFileName()
free(fileName);
}
-int cFileName::Open(void)
+cUnbufferedFile *cFileName::Open(void)
{
- if (file < 0) {
+ if (!file) {
int BlockingFlag = blocking ? 0 : O_NONBLOCK;
if (record) {
dsyslog("recording to '%s'", fileName);
file = OpenVideoFile(fileName, O_RDWR | O_CREAT | BlockingFlag);
- if (file < 0)
+ if (!file)
LOG_ERROR_STR(fileName);
}
else {
if (access(fileName, R_OK) == 0) {
dsyslog("playing '%s'", fileName);
- file = open(fileName, O_RDONLY | BlockingFlag);
- if (file < 0)
+ file = cUnbufferedFile::Create(fileName, O_RDONLY | BlockingFlag);
+ if (!file)
LOG_ERROR_STR(fileName);
}
else if (errno != ENOENT)
@@ -1300,14 +1305,14 @@ int cFileName::Open(void)
void cFileName::Close(void)
{
- if (file >= 0) {
- if ((record && CloseVideoFile(file) < 0) || (!record && close(file) < 0))
+ if (file) {
+ if ((record && CloseVideoFile(file) < 0) || (!record && file->Close() < 0))
LOG_ERROR_STR(fileName);
- file = -1;
+ file = NULL;
}
}
-int cFileName::SetOffset(int Number, int Offset)
+cUnbufferedFile *cFileName::SetOffset(int Number, int Offset)
{
if (fileNumber != Number)
Close();
@@ -1332,23 +1337,23 @@ int cFileName::SetOffset(int Number, int Offset)
}
else if (errno != ENOENT) { // something serious has happened
LOG_ERROR_STR(fileName);
- return -1;
+ return NULL;
}
// found a non existing file suffix
}
if (Open() >= 0) {
- if (!record && Offset >= 0 && lseek(file, Offset, SEEK_SET) != Offset) {
+ if (!record && Offset >= 0 && file->Seek(Offset, SEEK_SET) != Offset) {
LOG_ERROR_STR(fileName);
- return -1;
+ return NULL;
}
}
return file;
}
esyslog("ERROR: max number of files (%d) exceeded", MAXFILESPERRECORDING);
- return -1;
+ return NULL;
}
-int cFileName::NextFile(void)
+cUnbufferedFile *cFileName::NextFile(void)
{
return SetOffset(fileNumber + 1);
}
@@ -1382,7 +1387,7 @@ int SecondsToFrames(int Seconds)
// --- ReadFrame -------------------------------------------------------------
-int ReadFrame(int f, uchar *b, int Length, int Max)
+int ReadFrame(cUnbufferedFile *f, uchar *b, int Length, int Max)
{
if (Length == -1)
Length = Max; // this means we read up to EOF (see cIndex)
@@ -1390,10 +1395,8 @@ int ReadFrame(int f, uchar *b, int Length, int Max)
esyslog("ERROR: frame larger than buffer (%d > %d)", Length, Max);
Length = Max;
}
- int r = safe_read(f, b, Length);
+ int r = f->Read(b, Length);
if (r < 0)
LOG_ERROR;
return r;
}
-
-
diff --git a/recording.h b/recording.h
index 341284f..28a1cd2 100644
--- a/recording.h
+++ b/recording.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: recording.h 1.45 2005/10/01 10:24:41 kls Exp $
+ * $Id: recording.h 1.46 2005/10/31 12:27:12 kls Exp $
*/
#ifndef __RECORDING_H
@@ -203,7 +203,7 @@ public:
class cFileName {
private:
- int file;
+ cUnbufferedFile *file;
int fileNumber;
char *fileName, *pFileNumber;
bool record;
@@ -213,10 +213,10 @@ public:
~cFileName();
const char *Name(void) { return fileName; }
int Number(void) { return fileNumber; }
- int Open(void);
+ cUnbufferedFile *Open(void);
void Close(void);
- int SetOffset(int Number, int Offset = 0);
- int NextFile(void);
+ cUnbufferedFile *SetOffset(int Number, int Offset = 0);
+ cUnbufferedFile *NextFile(void);
};
cString IndexToHMSF(int Index, bool WithFrame = false);
@@ -226,7 +226,7 @@ int HMSFToIndex(const char *HMSF);
int SecondsToFrames(int Seconds); //XXX+ ->player???
// Returns the number of frames corresponding to the given number of seconds.
-int ReadFrame(int f, uchar *b, int Length, int Max);
+int ReadFrame(cUnbufferedFile *f, uchar *b, int Length, int Max);
char *ExchangeChars(char *s, bool ToFileSystem);
// Exchanges the characters in the given string to or from a file system
diff --git a/sources.conf b/sources.conf
index 3ba2f50..b318468 100644
--- a/sources.conf
+++ b/sources.conf
@@ -91,13 +91,22 @@ S58W PAS 9
S61.5W Echostar 3
S79W AMC5
S82W Nimiq 2
+S85W AMC2
S87W AMC3
-S91W Nimiq 1
+S89W Intelsat 808
+S91W Galaxy 11 & Nimiq 1/3
+S93W Intelsat 806
+S95W Galaxy 3C
S97W Telestar 5
-S105W AMC2
+S99W Galaxy 4R
+S101W AMC4
+S103W AMC1
+S105W AMC15
S110W Echostar 6/8
S119W Echostar 7
-S121W Echostar 9
+S121W Echostar 9 & Intelsat 813
+S123W Galaxy 10R
+S129W Intelsat 807
S148W Echostar 1/2
S157W Echostar 4
diff --git a/svdrp.h b/svdrp.h
index baa4fb3..9275bf2 100644
--- a/svdrp.h
+++ b/svdrp.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: svdrp.h 1.23 2005/08/28 14:10:32 kls Exp $
+ * $Id: svdrp.h 1.24 2005/10/09 11:11:59 kls Exp $
*/
#ifndef __SVDRP_H
@@ -51,7 +51,7 @@ private:
time_t lastActivity;
void Close(bool Timeout = false);
bool Send(const char *s, int length = -1);
- void Reply(int Code, const char *fmt, ...);
+ void Reply(int Code, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
void PrintHelpTopics(const char **hp);
void CmdCHAN(const char *Option);
void CmdCLRE(const char *Option);
diff --git a/thread.h b/thread.h
index 4eb09a1..e72677f 100644
--- a/thread.h
+++ b/thread.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: thread.h 1.30 2005/08/14 11:21:48 kls Exp $
+ * $Id: thread.h 1.31 2005/10/09 11:12:32 kls Exp $
*/
#ifndef __THREAD_H
@@ -106,7 +106,7 @@ public:
///< the thread starts and stops. The Start() function must be called
///< to actually start the thread.
virtual ~cThread();
- void SetDescription(const char *Description, ...);
+ void SetDescription(const char *Description, ...) __attribute__ ((format (printf, 2, 3)));
bool Start(void);
///< Actually starts the thread.
bool Active(void);
diff --git a/tools.c b/tools.c
index dbd78c9..aa20e6e 100644
--- a/tools.c
+++ b/tools.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.c 1.99 2005/09/25 12:56:06 kls Exp $
+ * $Id: tools.c 1.100 2005/10/31 12:56:15 kls Exp $
*/
#include "tools.h"
@@ -836,6 +836,129 @@ bool cSafeFile::Close(void)
return result;
}
+// --- cUnbufferedFile -------------------------------------------------------
+
+#define READ_AHEAD MEGABYTE(2)
+#define WRITE_BUFFER MEGABYTE(10)
+
+cUnbufferedFile::cUnbufferedFile(void)
+{
+ fd = -1;
+}
+
+cUnbufferedFile::~cUnbufferedFile()
+{
+ Close();
+}
+
+int cUnbufferedFile::Open(const char *FileName, int Flags, mode_t Mode)
+{
+ Close();
+ fd = open(FileName, Flags, Mode);
+ begin = end = ahead = -1;
+ written = 0;
+ return fd;
+}
+
+int cUnbufferedFile::Close(void)
+{
+ if (fd >= 0) {
+ if (ahead > end)
+ end = ahead;
+ if (begin >= 0 && end > begin) {
+ //dsyslog("close buffer: %d (flush: %d bytes, %ld-%ld)", fd, written, begin, end);
+ if (written)
+ fdatasync(fd);
+ posix_fadvise(fd, begin, end - begin, POSIX_FADV_DONTNEED);
+ }
+ begin = end = ahead = -1;
+ written = 0;
+ }
+ int OldFd = fd;
+ fd = -1;
+ return close(OldFd);
+}
+
+off_t cUnbufferedFile::Seek(off_t Offset, int Whence)
+{
+ if (fd >= 0)
+ return lseek(fd, Offset, Whence);
+ return -1;
+}
+
+ssize_t cUnbufferedFile::Read(void *Data, size_t Size)
+{
+ if (fd >= 0) {
+ off_t pos = lseek(fd, 0, SEEK_CUR);
+ // jump forward - adjust end position
+ if (pos > end)
+ end = pos;
+ // after adjusting end - don't clear more than previously requested
+ if (end > ahead)
+ end = ahead;
+ // jump backward - drop read ahead of previous run
+ if (pos < begin)
+ end = ahead;
+ if (begin >= 0 && end > begin)
+ posix_fadvise(fd, begin - KILOBYTE(200), end - begin + KILOBYTE(200), POSIX_FADV_DONTNEED);//XXX macros/parameters???
+ begin = pos;
+ ssize_t bytesRead = safe_read(fd, Data, Size);
+ if (bytesRead > 0) {
+ pos += bytesRead;
+ end = pos;
+ // this seems to trigger a non blocking read - this
+ // may or may not have been finished when we will be called next time.
+ // If it is not finished we can't release the not yet filled buffers.
+ // So this is commented out till we find a better solution.
+ //posix_fadvise(fd, pos, READ_AHEAD, POSIX_FADV_WILLNEED);
+ ahead = pos + READ_AHEAD;
+ }
+ else
+ end = pos;
+ return bytesRead;
+ }
+ return -1;
+}
+
+ssize_t cUnbufferedFile::Write(const void *Data, size_t Size)
+{
+ if (fd >=0) {
+ off_t pos = lseek(fd, 0, SEEK_CUR);
+ ssize_t bytesWritten = safe_write(fd, Data, Size);
+ if (bytesWritten >= 0) {
+ written += bytesWritten;
+ if (begin >= 0) {
+ if (pos < begin)
+ begin = pos;
+ }
+ else
+ begin = pos;
+ if (pos + bytesWritten > end)
+ end = pos + bytesWritten;
+ if (written > WRITE_BUFFER) {
+ //dsyslog("flush buffer: %d (%d bytes, %ld-%ld)", fd, written, begin, end);
+ fdatasync(fd);
+ if (begin >= 0 && end > begin)
+ posix_fadvise(fd, begin, end - begin, POSIX_FADV_DONTNEED);
+ begin = end = -1;
+ written = 0;
+ }
+ }
+ return bytesWritten;
+ }
+ return -1;
+}
+
+cUnbufferedFile *cUnbufferedFile::Create(const char *FileName, int Flags, mode_t Mode)
+{
+ cUnbufferedFile *File = new cUnbufferedFile;
+ if (File->Open(FileName, Flags, Mode) < 0) {
+ delete File;
+ File = NULL;
+ }
+ return File;
+}
+
// --- cLockFile -------------------------------------------------------------
#define LOCKFILENAME ".lock-vdr"
diff --git a/tools.h b/tools.h
index 97f4262..f348b2e 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 1.79 2005/10/01 12:43:31 kls Exp $
+ * $Id: tools.h 1.81 2005/10/31 12:54:36 kls Exp $
*/
#ifndef __TOOLS_H
@@ -81,7 +81,7 @@ public:
operator const char * () const { return s; } // for use in (const char *) context
const char * operator*() const { return s; } // for use in (const void *) context (printf() etc.)
cString &operator=(const cString &String);
- static cString sprintf(const char *fmt, ...);
+ static cString sprintf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
};
ssize_t safe_read(int filedes, void *buffer, size_t size);
@@ -198,6 +198,27 @@ public:
bool Close(void);
};
+/// cUnbufferedFile is used for large files that are mainly written or read
+/// in a streaming manner, and thus should not be cached.
+
+class cUnbufferedFile {
+private:
+ int fd;
+ off_t begin;
+ off_t end;
+ off_t ahead;
+ ssize_t written;
+public:
+ cUnbufferedFile(void);
+ ~cUnbufferedFile();
+ int Open(const char *FileName, int Flags, mode_t Mode = DEFFILEMODE);
+ int Close(void);
+ off_t Seek(off_t Offset, int Whence);
+ ssize_t Read(void *Data, size_t Size);
+ ssize_t Write(const void *Data, size_t Size);
+ static cUnbufferedFile *Create(const char *FileName, int Flags, mode_t Mode = DEFFILEMODE);
+ };
+
class cLockFile {
private:
char *fileName;
diff --git a/vdr.1 b/vdr.1
index af8ce12..f50db90 100644
--- a/vdr.1
+++ b/vdr.1
@@ -8,7 +8,7 @@
.\" License as specified in the file COPYING that comes with the
.\" vdr distribution.
.\"
-.\" $Id: vdr.1 1.14 2005/07/31 10:49:35 kls Exp $
+.\" $Id: vdr.1 1.15 2005/10/09 12:31:03 kls Exp $
.\"
.TH vdr 1 "19 Dec 2004" "1.3.18" "Video Disk Recorder"
.SH NAME
@@ -166,7 +166,7 @@ access to the SVDRP port.
.I marks.vdr
Contains the editing marks defined for a recording.
.TP
-.I summary.vdr
+.I info.vdr
Contains a description of the recording.
.TP
.I resume.vdr
diff --git a/vdr.c b/vdr.c
index 0fab189..9d84d84 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/vdr
*
- * $Id: vdr.c 1.217 2005/09/24 13:27:26 kls Exp $
+ * $Id: vdr.c 1.218 2005/10/09 10:01:45 kls Exp $
*/
#include <getopt.h>
@@ -370,17 +370,11 @@ int main(int argc, char *argv[])
// Daemon mode:
if (DaemonMode) {
- pid_t pid = fork();
- if (pid < 0) {
+ if (daemon(1, 0) == -1) {
fprintf(stderr, "%m\n");
esyslog("ERROR: %m");
return 2;
}
- if (pid != 0)
- return 0; // initial program immediately returns
- fclose(stdin);
- fclose(stdout);
- fclose(stderr);
}
else if (Terminal) {
// Claim new controlling terminal
diff --git a/videodir.c b/videodir.c
index cb3d29a..5206d0c 100644
--- a/videodir.c
+++ b/videodir.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: videodir.c 1.12 2005/08/06 09:53:21 kls Exp $
+ * $Id: videodir.c 1.13 2005/10/31 12:07:41 kls Exp $
*/
#include "videodir.h"
@@ -102,7 +102,7 @@ const char *cVideoDirectory::Adjust(const char *FileName)
return NULL;
}
-int OpenVideoFile(const char *FileName, int Flags)
+cUnbufferedFile *OpenVideoFile(const char *FileName, int Flags)
{
const char *ActualFileName = FileName;
@@ -110,7 +110,7 @@ int OpenVideoFile(const char *FileName, int Flags)
if (strstr(FileName, VideoDirectory) != FileName) {
esyslog("ERROR: %s not in %s", FileName, VideoDirectory);
errno = ENOENT; // must set 'errno' - any ideas for a better value?
- return -1;
+ return NULL;
}
// Are we going to create a new file?
if ((Flags & O_CREAT) != 0) {
@@ -128,25 +128,26 @@ int OpenVideoFile(const char *FileName, int Flags)
if (Dir.Stored()) {
ActualFileName = Dir.Adjust(FileName);
if (!MakeDirs(ActualFileName, false))
- return -1; // errno has been set by MakeDirs()
+ return NULL; // errno has been set by MakeDirs()
if (symlink(ActualFileName, FileName) < 0) {
LOG_ERROR_STR(FileName);
- return -1;
+ return NULL;
}
ActualFileName = strdup(ActualFileName); // must survive Dir!
}
}
}
- int Result = open(ActualFileName, Flags, DEFFILEMODE);
+ cUnbufferedFile *File = cUnbufferedFile::Create(ActualFileName, Flags, DEFFILEMODE);
if (ActualFileName != FileName)
free((char *)ActualFileName);
- return Result;
+ return File;
}
-int CloseVideoFile(int FileHandle)
+int CloseVideoFile(cUnbufferedFile *File)
{
- // just in case we ever decide to do something special when closing the file!
- return close(FileHandle);
+ int Result = File->Close();
+ delete File;
+ return Result;
}
bool RenameVideoFile(const char *OldName, const char *NewName)
diff --git a/videodir.h b/videodir.h
index b9e38cb..6dd2d8c 100644
--- a/videodir.h
+++ b/videodir.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: videodir.h 1.5 2004/12/26 11:52:56 kls Exp $
+ * $Id: videodir.h 1.6 2005/10/31 11:50:23 kls Exp $
*/
#ifndef __VIDEODIR_H
@@ -15,8 +15,8 @@
extern const char *VideoDirectory;
-int OpenVideoFile(const char *FileName, int Flags);
-int CloseVideoFile(int FileHandle);
+cUnbufferedFile *OpenVideoFile(const char *FileName, int Flags);
+int CloseVideoFile(cUnbufferedFile *File);
bool RenameVideoFile(const char *OldName, const char *NewName);
bool RemoveVideoFile(const char *FileName);
bool VideoFileSpaceAvailable(int SizeMB);