summaryrefslogtreecommitdiff
path: root/dvbdevice.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <Klaus (dot) Schmidinger (at) tvdr (dot) de>2012-02-19 14:54:00 +0100
committerDieter Hametner <dh (plus) vdr (at) gekrumbel (dot) de>2012-02-19 16:36:45 +0100
commitc2d9577b3dd7557b7a9c702d5c1fd3b1bbe0e5e7 (patch)
treea59a457cc3975f5835e7b307dccc5fd0f0e1b1be /dvbdevice.c
parent59f0138a7d03fed4fc33e1083928bf5b28e0e4ff (diff)
downloadvdr-patches-c2d9577b3dd7557b7a9c702d5c1fd3b1bbe0e5e7.tar.gz
vdr-patches-c2d9577b3dd7557b7a9c702d5c1fd3b1bbe0e5e7.tar.bz2
Version 1.7.24
Original announce message: VDR developer version 1.7.24 is now available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.24.tar.bz2 A 'diff' against the previous version is available at ftp://ftp.tvdr.de/vdr/Developer/vdr-1.7.23-1.7.24.diff MD5 checksums: a034c5e399417dfc583483f650d003ee vdr-1.7.24.tar.bz2 aa1a2b202da92e65945ff39470b26618 vdr-1.7.23-1.7.24.diff WARNING: ======== This is a developer version. Even though I use it in my productive environment. I strongly recommend that you only use it under controlled conditions and for testing and debugging. From the HISTORY file: - Updated the Italian OSD texts (thanks to Diego Pierotto). - Fixed a high load in case a transponder can't be received. - Improved the way DVB_API_VERSION is checked. - Updated the Finnish OSD texts (thanks to Rolf Ahrenberg). - Fixed asserting there is a live programme if the primary device is bonded with a device that starts a recording on a different band. - Fixed the return type of cMyDeviceHook::DeviceProvidesTransponder() in PLUGINS.html. - Fixed a crash in a plugin using cDeviceHook when VDR ends (reported by Oliver Endriss). - Some improvements to the Makefiles (thanks to Christian Ruppert). - Fixed cRecording::LengthInSeconds(), which wrongfully rounded the result to full minutes (thanks to Christoph Haubrich). - Symbolic links are no longer resolved in cRecordings::ScanVideoDir() (thanks to Sundararaj Reel). - The epg.data file is now read in a separate thread to make the startup process faster in case the file is very large (suggested by Helmut Auer). - Fixed selecting the primary device for receiving the live viewing channel in case it is bonded with an other device and has no receiver attached to it. - Fixed a possible crash when canceling VDR while displaying subtitles, and the primary device is no longer available. - Improved handling subtitles of BBC channels. - No longer using tabs as delimiter in the EPG bugfix log (they were garbled in the log file). - Added a missing '.' after the month in VPS strings. - Added some missing 'const' to cDevice (thanks to Joachim Wilke). - Fixed handling the PrimaryLimit when requesting a device for live viewing (reported by Uwe Scheffler). - Removed superfluous calls to SetVideoFormat() from device constructors. This function is called in cDevice::SetPrimaryDevice(), anyway. - An ongoing editing process is now canceled if either the original or the edited version of the recording is deleted from the Recordings menu. - The SVDRP command DELR now won't delete a recording that is currently being edited. - Removed code stub for obsolete SVDRP command MOVT. - The DVB device adapters/frontends are now probed by scanning the /dev/dvb directory instead of looping through adapter/frontend numbers. This allows for "holes" in the device numbering. - cReadDir::Next() now skips directory entries "." and "..". - Fixed a possible deadlock in time shift mode. - Fixed switching into time shift mode when pausing live video (thanks to Reinhard Nissl for helping to debug this one).
Diffstat (limited to 'dvbdevice.c')
-rw-r--r--dvbdevice.c78
1 files changed, 50 insertions, 28 deletions
diff --git a/dvbdevice.c b/dvbdevice.c
index 3915397..c2503ed 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbdevice.c 2.56 2012/01/15 14:31:47 kls Exp $
+ * $Id: dvbdevice.c 2.62 2012/02/17 12:20:34 kls Exp $
*/
#include "dvbdevice.h"
@@ -502,6 +502,8 @@ void cDvbTuner::SetChannel(const cChannel *Channel)
tunerStatus = tsIdle;
ResetToneAndVoltage();
}
+ if (bondedTuner && device->IsPrimaryDevice())
+ cDevice::PrimaryDevice()->DelLivePids(); // 'device' is const, so we must do it this way
}
bool cDvbTuner::Locked(int TimeoutMs)
@@ -857,6 +859,7 @@ void cDvbTuner::Action(void)
if (GetFrontendStatus(NewStatus))
Status = NewStatus;
cMutexLock MutexLock(&mutex);
+ int WaitTime = 1000;
switch (tunerStatus) {
case tsIdle:
break;
@@ -877,6 +880,7 @@ void cDvbTuner::Action(void)
bondedMasterFailed = true; // give an other tuner a chance in case the sat cable was disconnected
continue;
}
+ WaitTime = 100; // allows for a quick change from tsTuned to tsLocked
case tsLocked:
if (Status & FE_REINIT) {
tunerStatus = tsSet;
@@ -905,9 +909,7 @@ void cDvbTuner::Action(void)
break;
default: esyslog("ERROR: unknown tuner status %d", tunerStatus);
}
-
- if (tunerStatus != tsTuned)
- newSet.TimedWait(mutex, 1000);
+ newSet.TimedWait(mutex, WaitTime);
}
}
@@ -1006,6 +1008,7 @@ cDvbDevice::cDvbDevice(int Adapter, int Frontend)
numModulations = 0;
bondedDevice = NULL;
needsDetachBondedReceivers = false;
+ tsBuffer = NULL;
// Devices that are present on all card types:
@@ -1045,7 +1048,7 @@ cDvbDevice::~cDvbDevice()
cString cDvbDevice::DvbName(const char *Name, int Adapter, int Frontend)
{
- return cString::sprintf("%s%d/%s%d", DEV_DVB_ADAPTER, Adapter, Name, Frontend);
+ return cString::sprintf("%s/%s%d/%s%d", DEV_DVB_BASE, DEV_DVB_ADAPTER, Adapter, Name, Frontend);
}
int cDvbDevice::DvbOpen(const char *Name, int Adapter, int Frontend, int Mode, bool ReportError)
@@ -1093,28 +1096,47 @@ bool cDvbDevice::Initialize(void)
new cDvbSourceParam('C', "DVB-C");
new cDvbSourceParam('S', "DVB-S");
new cDvbSourceParam('T', "DVB-T");
+ cStringList Nodes;
+ cReadDir DvbDir(DEV_DVB_BASE);
+ if (DvbDir.Ok()) {
+ struct dirent *a;
+ while ((a = DvbDir.Next()) != NULL) {
+ if (strstr(a->d_name, DEV_DVB_ADAPTER) == a->d_name) {
+ int Adapter = strtol(a->d_name + strlen(DEV_DVB_ADAPTER), NULL, 10);
+ cReadDir AdapterDir(AddDirectory(DEV_DVB_BASE, a->d_name));
+ if (AdapterDir.Ok()) {
+ struct dirent *f;
+ while ((f = AdapterDir.Next()) != NULL) {
+ if (strstr(f->d_name, DEV_DVB_FRONTEND) == f->d_name) {
+ int Frontend = strtol(f->d_name + strlen(DEV_DVB_FRONTEND), NULL, 10);
+ Nodes.Append(strdup(cString::sprintf("%2d %2d", Adapter, Frontend)));
+ }
+ }
+ }
+ }
+ }
+ }
int Checked = 0;
int Found = 0;
- for (int Adapter = 0; ; Adapter++) {
- for (int Frontend = 0; ; Frontend++) {
- if (Exists(Adapter, Frontend)) {
- if (Checked++ < MAXDVBDEVICES) {
- if (UseDevice(NextCardIndex())) {
- if (Probe(Adapter, Frontend))
- Found++;
- }
- else
- NextCardIndex(1); // skips this one
- }
- }
- else if (Frontend == 0)
- goto LastAdapter;
- else
- goto NextAdapter;
- }
- NextAdapter: ;
- }
-LastAdapter:
+ if (Nodes.Size() > 0) {
+ Nodes.Sort();
+ for (int i = 0; i < Nodes.Size(); i++) {
+ int Adapter;
+ int Frontend;
+ if (2 == sscanf(Nodes[i], "%d %d", &Adapter, &Frontend)) {
+ if (Exists(Adapter, Frontend)) {
+ if (Checked++ < MAXDVBDEVICES) {
+ if (UseDevice(NextCardIndex())) {
+ if (Probe(Adapter, Frontend))
+ Found++;
+ }
+ else
+ NextCardIndex(1); // skips this one
+ }
+ }
+ }
+ }
+ }
NextCardIndex(MAXDVBDEVICES - Checked); // skips the rest
if (Found > 0)
isyslog("found %d DVB device%s", Found, Found > 1 ? "s" : "");
@@ -1130,7 +1152,7 @@ bool cDvbDevice::QueryDeliverySystems(int fd_frontend)
LOG_ERROR;
return false;
}
-#if DVB_API_VERSION > 5 || DVB_API_VERSION_MINOR >= 5
+#if (DVB_API_VERSION << 8 | DVB_API_VERSION_MINOR) >= 0x0505
dtv_property Frontend[1];
memset(&Frontend, 0, sizeof(Frontend));
dtv_properties CmdSeq;
@@ -1440,7 +1462,7 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne
result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
}
else
- needsDetachReceivers = true;
+ needsDetachReceivers = Receiving(true);
}
if (result) {
if (!BondingOk(Channel)) {
@@ -1452,7 +1474,7 @@ bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *Ne
}
}
needsDetachBondedReceivers = true;
- needsDetachReceivers = true;
+ needsDetachReceivers = Receiving(true);
}
}
}