summaryrefslogtreecommitdiff
path: root/dvbapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'dvbapi.c')
-rw-r--r--dvbapi.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/dvbapi.c b/dvbapi.c
index 0562a4f..9f9cbab 100644
--- a/dvbapi.c
+++ b/dvbapi.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: dvbapi.c 1.22 2000/08/06 14:06:14 kls Exp $
+ * $Id: dvbapi.c 1.24 2000/09/10 10:25:09 kls Exp $
*/
#include "dvbapi.h"
@@ -1097,16 +1097,34 @@ cDvbApi::~cDvbApi()
delete replayTitle;
}
+bool cDvbApi::SetPrimaryDvbApi(int n)
+{
+ n--;
+ if (0 <= n && n < NumDvbApis && dvbApi[n]) {
+ isyslog(LOG_INFO, "setting primary DVB to %d", n + 1);
+ PrimaryDvbApi = dvbApi[n];
+ return true;
+ }
+ esyslog(LOG_ERR, "invalid DVB interface: %d", n + 1);
+ return false;
+}
+
cDvbApi *cDvbApi::GetDvbApi(int Ca)
{
+ cDvbApi *d = NULL;
Ca--;
for (int i = MAXDVBAPI; --i >= 0; ) {
- if (dvbApi[i]) {
- if ((i == Ca || Ca < 0) && !dvbApi[i]->Recording())
+ if (dvbApi[i] && !dvbApi[i]->Recording()) {
+ if (i == Ca)
return dvbApi[i];
+ if (Ca < 0) {
+ d = dvbApi[i];
+ if (d != PrimaryDvbApi)
+ break;
+ }
}
}
- return NULL;
+ return d;
}
int cDvbApi::Index(void)
@@ -1199,6 +1217,10 @@ void cDvbApi::Cmd(OSD_Command cmd, int color, int x0, int y0, int x1, int y1, co
dc.y1 = y1;
dc.data = (void *)data;
ioctl(videoDev, VIDIOCSOSDCOMMAND, &dc);
+ usleep(10); // XXX Workaround for a driver bug (cInterface::DisplayChannel() displayed texts at wrong places
+ // XXX and sometimes the OSD was no longer displayed).
+ // XXX Increase the value if the problem still persists on your particular system.
+ // TODO Check if this is still necessary with driver versions after 0.6.
}
}
#endif