Commit 3bd9a7cc authored by Klaus Schmidinger's avatar Klaus Schmidinger

Version 1.1.32

- Removed a faulty parameter initialization in menu.c (thanks to Lauri Tischler for
  reporting this one).
- Re-implemented the WaitForPut/WaitForGet stuff in cRingBuffer, since some plugins
  actually need this. By default the buffer does not wait; if a plugin needs the
  waiting functionality it can call the new SetTimeouts() function.
- Moved the call to cPlugin::Start() further up in vdr.c, to make sure it gets
  called before trying to learn the keys (problem reported by Oliver Endriss).
- No longer starting the editing process if no marks have been set (thanks to
  Matthias Raus for reporting this one).
- Added Catalanian language texts (thanks to Marc Rovira Vall and Ramon Roca).
  Plugin authors may want to add the new entries to their I18N texts and contact
  the translators to have their texts translated. Note that there are now 16
  different OSD languages, so please make sure you have 16 versions for each of
  your texts.
- Moved the detection of a broken video data stream from the cDevice into the
  cRecorder to avoid problems with cReceivers that want to receive from PIDs
  that are currently not transmitting (thanks to Marcel Wiesweg for reporting
  this one).
- Fixed setting the locking pid after a timed wait (thanks to Andreas Schultz).
- Avoiding spurious section filter settings after a channel switch.
- Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt).
- Fixed reading 'epg.data' for channels with non-zero RID (thanks to Oliver
  Endriss for reporting this one).
- Fixed EPG bugfix statistics to avoid log entires for undefined channels (thanks
  to Lars Bläser for reporting this one).
- No longer waiting inside cIndexFile::CatchUp() to avoid shortly blocking replay
  at the end of a recording.
parent c8402255
......@@ -204,6 +204,7 @@ Andreas Schultz <aschultz@warp10.net>
for suggesting to separate the startup of a plugin into an "early" and a "late" phase
for changing C++ style comments in libdtv into C style to avoid warnings in gcc 3.x
for implementing the TerrestrialDeliverySystemDescriptor in libdtv
for fixing setting the locking pid after a timed wait
Aaron Holtzman
for writing 'ac3dec'
......@@ -467,6 +468,9 @@ Oliver Endriss <o.endriss@gmx.de>
the Main menu
for reporting a bug in setting the PCR-PID in case it is equal to one of the other
PIDs
for reporting a problem with cPlugin::Start() being called after trying to learn
the remote control keys
for reporting a bug in reading 'epg.data' for channels with non-zero RID
Reinhard Walter Buchner <rw.buchner@freenet.de>
for adding some satellites to 'sources.conf'
......@@ -475,6 +479,7 @@ Reinhard Walter Buchner <rw.buchner@freenet.de>
Lauri Tischler <lauri.tischler@efore.fi>
for helping to test and debug the new channel source and DiSEqC handling
for reporting a faulty parameter initialization in menu.c
Andy Carter <fruit@ukgateway.net>
for helping to test new DVB-T handling
......@@ -572,6 +577,8 @@ Jan Ekholm <chakie@infa.abo.fi>
Marcel Wiesweg <marcel.wiesweg@gmx.de>
for pointing out a problem with high CPU load during replay
for reporting broken support for raw OSDs of plugins
for reporting a problem with cReceivers that want to receive from PIDs that are
currently not transmitting
Torsten Herz <torsten.herz@web.de>
for fixing a possible deadlock when using the "Blue" button in the "Schedules" menu
......@@ -652,3 +659,13 @@ Juri Haberland <juri@koschikode.com>
Alfred Zastrow <vdr@zastrow4u.de>
for suggesting to implement separate PausePriority and PauseLifetime parameters for
the recordings created when pausing live video
Matthias Raus <matthias-raus@web.de>
for reporting a problem with starting the editing process if no marks have been set
Marc Rovira Vall <tm05462@salleURL.edu> and Ramon Roca <ramon.roca@xcombo.com>
for translating OSD texts to the Catalanian language
Lars Bläser <LBlaeser@hofheim.de>
for reporting a bug in EPG bugfix statistics which made log entires for undefined
channels
......@@ -2116,7 +2116,7 @@ Video Disk Recorder Revision History
(suggested by Andreas Schultz). Plugin authors should please read the section
about "Getting started" in PLUGINS.html and adapt their code if applicable.
- Implemented the CableDeliverySystemDescriptor and TerrestrialDeliverySystemDescriptor
in libdtv (thanks to Sven Grothklags and Andreas Schultz)
in libdtv (thanks to Sven Grothklags and Andreas Schultz).
- Fixed keeping live video active in case the primary device doesn't have an MPEG
decoder (thanks to Wolfgang Goeller for reporting this one).
- Implemented cDevice::ActualDevice(), which returns the actual receiving device in
......@@ -2142,3 +2142,33 @@ Video Disk Recorder Revision History
created when pausing live video (suggested by Alfred Zastrow).
- Changed C++ style comments in libdtv into C style to avoid warnings in gcc 3.x
(thanks to Andreas Schultz).
2003-05-18: Version 1.1.32
- Removed a faulty parameter initialization in menu.c (thanks to Lauri Tischler for
reporting this one).
- Re-implemented the WaitForPut/WaitForGet stuff in cRingBuffer, since some plugins
actually need this. By default the buffer does not wait; if a plugin needs the
waiting functionality it can call the new SetTimeouts() function.
- Moved the call to cPlugin::Start() further up in vdr.c, to make sure it gets
called before trying to learn the keys (problem reported by Oliver Endriss).
- No longer starting the editing process if no marks have been set (thanks to
Matthias Raus for reporting this one).
- Added Catalanian language texts (thanks to Marc Rovira Vall and Ramon Roca).
Plugin authors may want to add the new entries to their I18N texts and contact
the translators to have their texts translated. Note that there are now 16
different OSD languages, so please make sure you have 16 versions for each of
your texts.
- Moved the detection of a broken video data stream from the cDevice into the
cRecorder to avoid problems with cReceivers that want to receive from PIDs
that are currently not transmitting (thanks to Marcel Wiesweg for reporting
this one).
- Fixed setting the locking pid after a timed wait (thanks to Andreas Schultz).
- Avoiding spurious section filter settings after a channel switch.
- Updated 'channels.conf.cable' (thanks to Stefan Hußfeldt).
- Fixed reading 'epg.data' for channels with non-zero RID (thanks to Oliver
Endriss for reporting this one).
- Fixed EPG bugfix statistics to avoid log entires for undefined channels (thanks
to Lars Bläser for reporting this one).
- No longer waiting inside cIndexFile::CatchUp() to avoid shortly blocking replay
at the end of a recording.
......@@ -21,18 +21,18 @@ VDR program and present itself to the user.
The <i>internal</i> interface provides the plugin code access to VDR's internal data
structures and allows it to hook itself into specific areas to perform special actions.
<p>
<!--X1.1.15--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.15 are marked like this.
<!--X1.1.15--></td></tr></table>
<!--X1.1.17--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.1.17--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.17 are marked like this.
<!--X1.1.17--></td></tr></table>
<!--X1.1.27--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.1.27--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.27 are marked like this.
<!--X1.1.27--></td></tr></table>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.31 are marked like this.
<!--X1.1.31--></td></tr></table>
<!--X1.1.32--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
Important modifications introduced in version 1.1.32 are marked like this.
<!--X1.1.32--></td></tr></table>
<hr>
<h1>Table Of Contents</h1>
......@@ -284,7 +284,7 @@ The <b>constructor</b> shall initialize any member variables the plugin defines,
<b>must not access any global structures of VDR</b>.
It also must not create any threads or other large data structures. These things
are done in the
<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<a href="#Getting started"><tt>Initialize()</tt></a> or
<a href="#Getting started"><tt>Start()</tt></a>
<!--X1.1.31--></td></tr></table>
......@@ -460,18 +460,20 @@ thread of its own), or wants to make use of <a href="#Internationalization">inte
it needs to implement one of the functions
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%><pre>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%><pre>
virtual bool Initialize(void);
<!--X1.1.31--></pre></td></tr></table>
virtual bool Start(void);
</pre></td></tr></table><p>
which are called once for each plugin at program startup.
<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.1.32--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
The difference between these two functions is that <tt>Initialize()</tt> is
called early at program startup, while <tt>Start()</tt> is called after everything
else has been set up, right before the main program loop is entered. Inside the
<tt>Start()</tt> function of any plugin it is guaranteed that the <tt>Initialize()</tt>
called early at program startup, while <tt>Start()</tt> is called after the primary
device and user interface has been set up, but before the main program loop is entered.
<!--X1.1.32--></td></tr></table>
Inside the <tt>Start()</tt> function of any plugin it is guaranteed that the <tt>Initialize()</tt>
functions of all plugins have already been called. For many plugins it probably
doesn't matter which of these functions they implement, but it may be of importance
for, e.g., plugins that implement devices. Such plugins should create their cDevice
......@@ -527,7 +529,7 @@ in the call to VDR.
If the user selects the main menu entry of a plugin, VDR calls the function
<!--X1.1.17--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<!--X1.1.17--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
virtual cOsdObject *MainMenuAction(void);
</pre></td></tr></table><p>
......@@ -1044,7 +1046,6 @@ virtual void SetAudioTrack(int Index);
</pre></td></tr></table><p>
<p>
<!--X1.1.15--><table width=100%><tr><td bgcolor=#0000AA>&nbsp;</td><td width=100%>
If there is an additional audio track that has to be replayed with external hardware,
the player shall call its member function
......@@ -1053,7 +1054,6 @@ void PlayAudio(const uchar *Data, int Length);
</pre></td></tr></table><p>
where <tt>Data</tt> points to a complete audio PES packet of <tt>Length</tt> bytes.
<!--X1.1.15--></td></tr></table>
<p>
The second part needed here is a control object that receives user input from the main
program loop and reacts on this by telling the player what to do:
......@@ -1200,7 +1200,7 @@ a <tt>cDevice</tt>:
<p><table><tr><td bgcolor=#F0F0F0><pre><br>
cMyReceiver *Receiver = new cMyReceiver(123);
<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
cDevice::ActualDevice()-&gt;AttachReceiver(Receiver);
<!--X1.1.31--></td></tr></table>
</pre></td></tr></table><p>
......@@ -1372,7 +1372,7 @@ needed.
<p>
<b>Initializing new devices</b>
<p>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#FF0000>&nbsp;</td><td width=100%>
<!--X1.1.31--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
A derived cDevice class shall implement a static function
in which it determines whether the necessary hardware to run this sort of
device is actually present in this machine (or whatever other prerequisites
......@@ -1391,7 +1391,6 @@ shut down (delete) all devices when the program terminates. It is therefore
important that the devices are created on the heap, using the <tt>new</tt>
operator!
<!--X1.1.15--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
<a name="Dolby Digital"><hr><h2>Dolby Digital</h2>
<center><i><b>"The stereo effect may only be experienced if stereo equipment is used!"</b></i></center><p>
......@@ -1434,7 +1433,6 @@ will need to copy it for later processing in your thread.
<p>
The <tt>Mute()</tt> and <tt>Clear()</tt> functions will be called whenever the audio shall
be muted, or any buffered data shall be cleared, respectively.
<!--X1.1.15--></td></tr></table>
<a name="Remote Control"><hr><h2>Remote Control</h2>
......@@ -1502,7 +1500,7 @@ the incoming data (by calling your <tt>Action()</tt> function).
In case you need to do any other setup steps, like opening a file or initializing
member variables, you should do so before calling <tt>Start()</tt>.
<p>
<!--X1.1.27--><table width=100%><tr><td bgcolor=#AA0000>&nbsp;</td><td width=100%>
<!--X1.1.27--><table width=100%><tr><td bgcolor=#00AA00>&nbsp;</td><td width=100%>
If your remote control for some reason can't work (maybe because it was unable to
open some file handle it requires) it can implement the virtual function
......
......@@ -44,8 +44,8 @@ EinsMuXx:12110:h:S19.2E:27500:301:302:0:0:28203:0:0:0
ZDF Theaterkanal:11954:h:S19.2E:27500:1110:1120:0:0:28016:0:0:0
ZDF.doku:11954:h:S19.2E:27500:660:670:0:0:28014:0:0:0
MDR:12110:h:S19.2E:27500:401:402:404:0:28204:0:0:0
ORB:12110:h:S19.2E:27500:501:502:504:0:28205:0:0:0
B1:12110:h:S19.2E:27500:601:602:604:0:28206:0:0:0
RBB Brandenburg:12110:h:S19.2E:27500:501:502:504:0:28205:0:0:0
RBB Berlin:12110:h:S19.2E:27500:601:602:604:0:28206:0:0:0
:Premiere World
Premiere Start:11797:h:S19.2E:27500:255:256:0:101:8:0:0:0
Premiere 1:11797:h:S19.2E:27500:511:512,513;515:0:101:10:0:0:0
......
......@@ -45,19 +45,12 @@ DISCOVERY CHANNEL:354:M64:C:6900:1023:1024:0:101:14:0:0:0
PLANET:354:M64:C:6900:1535:1536:0:101:13:0:0:0
Fox Kids:354:M64:C:6900:1279:1280:0:101:28:0:0:0
Junior:354:M64:C:6900:255:256:0:101:19:0:0:0
K-TOON:354:M64:C:6900:511:512:0:101:12:0:0:0
HEIMATKANAL:386:M64:C:6900:1279:1280:0:101:22:0:0:0
GOLDSTAR TV:386:M64:C:6900:3839:3840:0:101:518:0:0:0
CLASSICA:386:M64:C:6900:767:768:0:101:15:0:0:0
:Premiere Sport
PREMIERE SPORT 1:362:M64:C:6900:255:256,257:0:101:17:0:0:0
PREMIERE SPORT 2:378:M64:C:6900:3839:3840,3841:0:101:27:0:0:0
:Premiere Bundesliga
Spiel 1:362:M64:C:6900:255:256:0:101:17:0:0:1
:Premiere CL
UEFA CL 1:362:M64:C:6900:255:256,257:0:101:17:0:0:2
:Premiere Formel 1
F1 Portal 1:362:M64:C:6900:255:256:0:101:17:0:0:3
:Premiere Direkt
PREMIERE DIREKT:378:M64:C:6900:2815:2816,2817;2819:0:101:18:0:0:0
:Premiere Direkt 1
......@@ -65,14 +58,14 @@ PREMIERE DIREKT 1A:362:M64:C:6900:2047:2048,2049;2051:0:101:240:0:0:0
PREMIERE DIREKT 1B:362:M64:C:6900:2303:2304,2305;2307:0:101:241:0:0:0
PREMIERE DIREKT 1C:362:M64:C:6900:2559:2560,2561;2563:0:101:242:0:0:0
:Premiere Direkt 2
PREMIERE DIREKT 2A:362:M64:C:6900:2815:2816,2817;2819:0:101:243:0:0:0
PREMIERE DIREKT 2A:354:M64:C:6900:511:512,513;515:0:101:211:0:0:0
PREMIERE DIREKT 2B:362:M64:C:6900:3071:3072,3073;3075:0:101:244:0:0:0
PREMIERE DIREKT 2C:362:M64:C:6900:3327:3328,3329;3331:0:101:245:0:0:0
PREMIERE DIREKT 2D:378:M64:C:6900:3071:3072,3073;3075:0:101:208:0:0:0
:Premiere Direkt 3
PREMIERE DIREKT 3A:378:M64:C:6900:3327:3328,3329;3331:0:101:209:0:0:0
PREMIERE DIREKT 3B:378:M64:C:6900:2303:2304,2305;2307:0:101:210:0:0:0
PREMIERE DIREKT 3C:354:M64:C:6900:511:512,513;515:0:101:211:0:0:0
PREMIERE DIREKT 3C:362:M64:C:6900:2815:2816,2817;2819:0:101:243:0:0:0
PREMIERE DIREKT 3D:386:M64:C:6900:511:512,513;515:0:101:212:0:0:0
:Premiere Erotik
BEATE-UHSE.TV:386:M64:C:6900:1023:1024:0:101:21:0:0:0
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.158 2003/05/11 13:45:44 kls Exp $
* $Id: config.h 1.159 2003/05/16 12:27:58 kls Exp $
*/
#ifndef __CONFIG_H
......@@ -19,8 +19,8 @@
#include "device.h"
#include "tools.h"
#define VDRVERSION "1.1.31"
#define VDRVERSNUM 10131 // Version * 10000 + Major * 100 + Minor
#define VDRVERSION "1.1.32"
#define VDRVERSNUM 10132 // Version * 10000 + Major * 100 + Minor
#define MAXPRIORITY 99
#define MAXLIFETIME 99
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: device.c 1.42 2003/05/11 08:53:09 kls Exp $
* $Id: device.c 1.43 2003/05/16 13:26:43 kls Exp $
*/
#include "device.h"
......@@ -25,10 +25,6 @@
// The default priority for non-primary devices:
#define DEFAULTPRIORITY -2
// The maximum time we wait before assuming that a recorded video data stream
// is broken:
#define MAXBROKENTIMEOUT 30 // seconds
int cDevice::numDevices = 0;
int cDevice::useDevice = 0;
int cDevice::nextCardIndex = 0;
......@@ -656,7 +652,6 @@ void cDevice::Action(void)
dsyslog("receiver thread started on device %d (pid=%d)", CardIndex() + 1, getpid());
if (OpenDvr()) {
time_t t = time(NULL);
active = true;
for (; active;) {
// Read data from the DVR device:
......@@ -671,18 +666,10 @@ void cDevice::Action(void)
receiver[i]->Receive(b, TS_SIZE);
}
Unlock();
t = time(NULL);
}
}
else
break;
//XXX+ put this into the recorder??? or give the receiver a flag whether it wants this?
if (time(NULL) - t > MAXBROKENTIMEOUT) {
esyslog("ERROR: video data stream broken on device %d", CardIndex() + 1);
cThread::EmergencyExit(true);
t = time(NULL);
}
}
CloseDvr();
}
......
......@@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: eit.c 1.75 2003/05/11 11:25:04 kls Exp $
* $Id: eit.c 1.78 2003/05/18 14:10:25 kls Exp $
***************************************************************************/
#include "eit.h"
......@@ -434,27 +434,33 @@ static void ReportEpgBugFixStats(bool Reset = false)
const char *delim = "\t";
tEpgBugFixStats *p = &EpgBugFixStats[i];
if (p->hits) {
if (!GotHits) {
dsyslog("=====================");
dsyslog("EPG bugfix statistics");
dsyslog("=====================");
dsyslog("IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED");
dsyslog("CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()");
dsyslog("IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!");
dsyslog("=====================");
dsyslog("Fix\tHits\tChannels");
GotHits = true;
}
bool PrintedStats = false;
char *q = buffer;
q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits);
*buffer = 0;
for (int c = 0; c < p->n; c++) {
cChannel *channel = Channels.GetByChannelID(p->channelIDs[c], true);
if (channel) {
if (!GotHits) {
dsyslog("=====================");
dsyslog("EPG bugfix statistics");
dsyslog("=====================");
dsyslog("IF SOMEBODY WHO IS IN CHARGE OF THE EPG DATA FOR ONE OF THE LISTED");
dsyslog("CHANNELS READS THIS: PLEASE TAKE A LOOK AT THE FUNCTION cEventInfo::FixEpgBugs()");
dsyslog("IN VDR/eit.c TO LEARN WHAT'S WRONG WITH YOUR DATA, AND FIX IT!");
dsyslog("=====================");
dsyslog("Fix\tHits\tChannels");
GotHits = true;
}
if (!PrintedStats) {
q += snprintf(q, sizeof(buffer) - (q - buffer), "%d\t%d", i, p->hits);
PrintedStats = true;
}
q += snprintf(q, sizeof(buffer) - (q - buffer), "%s%s", delim, channel->Name());
delim = ", ";
}
}
dsyslog("%s", buffer);
if (*buffer)
dsyslog("%s", buffer);
}
if (Reset)
p->hits = p->n = 0;
......@@ -807,6 +813,7 @@ cSchedules::~cSchedules()
/** */
const cSchedule *cSchedules::AddChannelID(tChannelID channelid)
{
channelid.ClrRid();
const cSchedule *p = GetSchedule(channelid);
if (!p) {
Add(new cSchedule(channelid));
......@@ -1073,6 +1080,7 @@ cSIProcessor::cSIProcessor(const char *FileName)
masterSIProcessor = numSIProcessors == 0; // the first one becomes the 'master'
currentSource = 0;
currentTransponder = 0;
statusCount = 0;
pmtIndex = 0;
pmtPid = 0;
filters = NULL;
......@@ -1150,6 +1158,7 @@ const char *cSIProcessor::GetEpgDataFileName(void)
void cSIProcessor::SetStatus(bool On)
{
LOCK_THREAD;
statusCount++;
ShutDownFilters();
pmtIndex = 0;
pmtPid = 0;
......@@ -1176,6 +1185,7 @@ void cSIProcessor::Action()
time_t lastCleanup = time(NULL);
time_t lastPmtScan = time(NULL);
int oldStatusCount = 0;
active = true;
while(active)
......@@ -1208,6 +1218,7 @@ void cSIProcessor::Action()
}
// set up pfd structures for all active filter
Lock();
pollfd pfd[MAX_FILTERS];
int NumUsedFilters = 0;
for (int a = 0; a < MAX_FILTERS ; a++)
......@@ -1219,6 +1230,8 @@ void cSIProcessor::Action()
NumUsedFilters++;
}
}
oldStatusCount = statusCount;
Unlock();
// wait until data becomes ready from the bitfilter
if (poll(pfd, NumUsedFilters, 1000) != 0)
......@@ -1239,6 +1252,8 @@ void cSIProcessor::Action()
//dsyslog("Received pid 0x%04X with table ID 0x%02X and length of %4d\n", pid, buf[0], seclen);
cMutexLock MutexLock(&schedulesMutex); // since the xMem... stuff is not thread safe, we need to use a "global" mutex
LOCK_THREAD;
if (statusCount != oldStatusCount)
break;
switch (pid)
{
case 0x00:
......
......@@ -16,7 +16,7 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* $Id: eit.h 1.28 2003/04/21 13:22:06 kls Exp $
* $Id: eit.h 1.29 2003/05/17 09:15:56 kls Exp $
***************************************************************************/
#ifndef __EIT_H
......@@ -148,6 +148,7 @@ private:
bool masterSIProcessor;
int currentSource;
int currentTransponder;
int statusCount;
int pmtIndex;
int pmtPid;
SIP_FILTER *filters;
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: i18n.h 1.5 2002/06/22 09:12:21 kls Exp $
* $Id: i18n.h 1.6 2003/05/16 12:48:52 kls Exp $
*/
#ifndef __I18N_H
......@@ -12,7 +12,7 @@
#include <stdio.h>
const int I18nNumLanguages = 15;
const int I18nNumLanguages = 16;
typedef const char *tI18nPhrase[I18nNumLanguages];
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 1.243 2003/05/11 13:58:13 kls Exp $
* $Id: menu.c 1.245 2003/05/16 12:40:12 kls Exp $
*/
#include "menu.h"
......@@ -2909,7 +2909,7 @@ eOSState cDisplayVolume::ProcessKey(eKeys Key)
// --- cRecordControl --------------------------------------------------------
cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause = false)
cRecordControl::cRecordControl(cDevice *Device, cTimer *Timer, bool Pause)
{
eventInfo = NULL;
instantId = NULL;
......@@ -3494,7 +3494,9 @@ void cReplayControl::EditCut(void)
if (fileName) {
Hide();
if (!cCutter::Active()) {
if (!cCutter::Start(fileName))
if (!marks.Count())
Interface->Error(tr("No editing marks defined!"));
else if (!cCutter::Start(fileName))
Interface->Error(tr("Can't start editing process!"));
else
Interface->Info(tr("Editing process started"));
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recorder.c 1.5 2003/01/25 16:23:36 kls Exp $
* $Id: recorder.c 1.6 2003/05/16 13:33:04 kls Exp $
*/
#include <stdarg.h>
......@@ -16,6 +16,10 @@
// (must be larger than MINVIDEODATA - see remux.h)
#define VIDEOBUFSIZE MEGABYTE(5)
// The maximum time we wait before assuming that a recorded video data stream
// is broken:
#define MAXBROKENTIMEOUT 30 // seconds
#define MINFREEDISKSPACE (512) // MB
#define DISKCHECKINTERVAL 100 // seconds
......@@ -110,6 +114,7 @@ void cRecorder::Action(void)
{
dsyslog("recording thread started (pid=%d)", getpid());
time_t t = time(NULL);
active = true;
while (active) {
int r;
......@@ -134,6 +139,12 @@ void cRecorder::Action(void)
else
break;
}
t = time(NULL);
}
else if (time(NULL) - t > MAXBROKENTIMEOUT) {
esyslog("ERROR: video data stream broken");
cThread::EmergencyExit(true);
t = time(NULL);
}
else
usleep(1); // this keeps the CPU load low
......
......@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: recording.c 1.77 2003/05/11 13:09:08 kls Exp $
* $Id: recording.c 1.78 2003/05/18 15:17:45 kls Exp $
*/
#include "recording.h"
......@@ -764,9 +764,6 @@ void cRecordingUserCommand::InvokeCommand(const char *State, const char *Recordi
#define INDEXFILESUFFIX "/index.vdr"
// The maximum time to wait before giving up while catching up on an index file:
#define MAXINDEXCATCHUP 2 // seconds
// The minimum age of an index file for considering it no longer to be written:
#define MININDEXAGE 3600 // seconds
......@@ -850,50 +847,47 @@ bool cIndexFile::CatchUp(int Index)
{
// returns true unless something really goes wrong, so that 'index' becomes NULL
if (index && f >= 0) {
for (int i = 0; i <= MAXINDEXCATCHUP && (Index < 0 || Index >= last); i++) {
struct stat buf;
if (fstat(f, &buf) == 0) {
if (time(NULL) - buf.st_mtime > MININDEXAGE) {
// apparently the index file is not being written any more
close(f);
f = -1;
break;
}
int newLast = buf.st_size / sizeof(tIndex) - 1;
if (newLast > last) {
if (size <= newLast) {
size *= 2;
if (size <= newLast)
size = newLast + 1;
}
index = (tIndex *)realloc(index, size * sizeof(tIndex));
if (index) {
int offset = (last + 1) * sizeof(tIndex);
int delta = (newLast - last) * sizeof(tIndex);
if (lseek(f, offset, SEEK_SET) == offset) {
if (safe_read(f, &index[last + 1], delta) != delta) {
esyslog("ERROR: can't read from index");
free(index);
index = NULL;
close(f);
f = -1;
break;
}
last = newLast;
}
else
LOG_ERROR_STR(fileName);
}
else
esyslog("ERROR: can't realloc() index");
}
}
else
LOG_ERROR_STR(fileName);
if (Index < last)
break;
sleep(1);
}
if (Index < 0 || Index >= last) {
struct stat buf;
if (fstat(f, &buf) == 0) {
if (time(NULL) - buf.st_mtime > MININDEXAGE) {
// apparently the index file is not being written any more
close(f);
f = -1;
return true;
}
int newLast = buf.st_size / sizeof(tIndex) - 1;
if (newLast > last) {
if (size <= newLast) {
size *= 2;
if (size <= newLast)
size = newLast + 1;
}
index = (tIndex *)realloc(index, size * sizeof(tIndex));
if (index) {
int offset = (last + 1) * sizeof(tIndex);
int delta = (newLast - last) * sizeof(tIndex);
if (lseek(f, offset, SEEK_SET) == offset) {
if (safe_read(f, &index[last + 1], delta) != delta) {
esyslog("ERROR: can't read from index");
free(index);
index = NULL;
close(f);
f = -1;
return true;
}
last = newLast;
}
else
LOG_ERROR_STR(fileName);
}
else
esyslog("ERROR: can't realloc() index");
}
}
else
LOG_ERROR_STR(fileName);
}
}
return index != NULL;
}
......
......@@ -7,7 +7,7 @@
* Parts of this file were inspired by the 'ringbuffy.c' from the
* LinuxDVB driver (see linuxtv.org).
*
* $Id: ringbuffer.c 1.16 2003/05/11 09:47:56 kls Exp $
* $Id: ringbuffer.c 1.17 2003/05/12 17:38:11 kls Exp $
*/
#include "ringbuffer.h"
......@@ -23,6 +23,7 @@ cRingBuffer::cRingBuffer(int Size, bool Statistics)
statistics = Statistics;
maxFill = 0;
lastPercent = 0;
putTimeout = getTimeout = 0;
}
cRingBuffer::~cRingBuffer()
......@@ -31,6 +32,42 @@ cRingBuffer::~cRingBuffer()
dsyslog("buffer stats: %d (%d%%) used", maxFill, maxFill * 100 / (size - 1));
}
void cRingBuffer::WaitForPut(void)
{
if (putTimeout) {
putMutex.Lock();
readyForPut.TimedWait(putMutex, putTimeout);
putMutex.Unlock();
}
}
void cRingBuffer::WaitForGet(void)
{
if (getTimeout) {
getMutex.Lock();
readyForGet.TimedWait(getMutex, getTimeout);
getMutex.Unlock();
}
}
void cRingBuffer::EnablePut(void)
{
if (putTimeout)
readyForPut.Broadcast();
}
void cRingBuffer::EnableGet(void)
{
if (getTimeout)
readyForGet.Broadcast();
}
void cRingBuffer::SetTimeouts(int PutTimeout, int GetTimeout)
{
putTimeout = PutTimeout;
getTimeout = GetTimeout;
}
// --- cRingBufferLinear -----------------------------------------------------
cRingBufferLinear::cRingBufferLinear(int Size, int Margin, bool Statistics)
......@@ -68,6 +105,8 @@ void cRingBufferLinear::Clear(void)
head = tail = margin;
lastGet = -1;
Unlock();
EnablePut();
EnableGet();
}
int cRingBufferLinear::Put(const uchar *Data, int Count)
......@@ -109,6 +148,9 @@ int cRingBufferLinear::Put(const uchar *Data, int Count)
else
Count = 0;
Unlock();
EnableGet();
if (Count == 0)
WaitForPut();
}
return Count;
}
......@@ -134,6 +176,8 @@ uchar *cRingBufferLinear::Get(int &Count)
Count = lastGet = cont;
}
Unlock();
if (!p)
WaitForGet();
return p;
}
......@@ -146,6 +190,7 @@ void cRingBufferLinear::Del(int Count)
if (tail >= Size())
tail = margin;
Unlock();
EnablePut();
}
else
esyslog("ERROR: invalid Count in cRingBufferLinear::Del: %d", Count);
......@@ -196,6 +241,8 @@ void cRingBufferFrame::Clear(void)
while ((p = Get()) != NULL)
Drop(p);
Unlock();
EnablePut();
EnableGet();
}
bool cRingBufferFrame::Put(cFrame *Frame)
......@@ -212,6 +259,7 @@ bool cRingBufferFrame::Put(cFrame *Frame)
}
currentFill += Frame->Count();
Unlock();
EnableGet();
return true;
}
return false;
......@@ -249,6 +297,7 @@ void cRingBufferFrame::Drop(cFrame *Frame)
esyslog("ERROR: attempt to drop wrong frame from ring buffer!");