diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-06-12 21:50:40 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-06-12 21:50:40 +0200 |
commit | afb2f1bdec2cef12fe363d1ef25034e993f5e63e (patch) | |
tree | 7769094c25f64c8594162f545fd401d48f2829f9 | |
parent | f8d8ea723315b2921c6b60f7567c8ceb89c9efd6 (diff) | |
download | vdr-afb2f1bdec2cef12fe363d1ef25034e993f5e63e.tar.gz vdr-afb2f1bdec2cef12fe363d1ef25034e993f5e63e.tar.bz2 |
Improved channel switching
-rw-r--r-- | HISTORY | 3 | ||||
-rw-r--r-- | dvbapi.c | 40 |
2 files changed, 27 insertions, 16 deletions
@@ -491,7 +491,7 @@ Video Disk Recorder Revision History - Updated version of Matthias Schniedermeyer's 'schnitt' tools. - New 'master-timer' tool (thanks to Matthias Schniedermeyer). -2001-06-03: Version 0.81 +2001-06-12: Version 0.81 - Fixed handling the case where the driver reports EAGAIN during recording, but no data comes within 5 seconds. @@ -504,3 +504,4 @@ Video Disk Recorder Revision History - Now 'runvdr' checks if the driver is already loaded (thanks to Henning Holtschneider). - Fixed removing recordings with Lifetime = 99. +- Improved channel switching. @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: dvbapi.c 1.70 2001/06/09 10:32:09 kls Exp $ + * $Id: dvbapi.c 1.71 2001/06/12 21:48:48 kls Exp $ */ #include "dvbapi.h" @@ -2046,6 +2046,12 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, CHECK(ioctl(fd_audio, AUDIO_CLEAR_BUFFER)); } + // Turn off current PIDs: + + CHECK(ioctl(fd_demuxv, DMX_STOP)); + CHECK(ioctl(fd_demuxa, DMX_STOP)); + CHECK(ioctl(fd_demuxt, DMX_STOP)); + bool ChannelSynced = false; if (fd_qpskfe >= 0 && fd_sec >= 0) { // DVB-S @@ -2095,14 +2101,16 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, // Wait for channel sync: - qpskEvent event; - int res = ioctl(fd_qpskfe, QPSK_GET_EVENT, &event); - if (res == -EBUFFEROVERFLOW) - res = ioctl(fd_qpskfe, QPSK_GET_EVENT, &event); - if (res >= 0) - ChannelSynced = event.type == FE_COMPLETION_EV; + if (cFile::FileReady(fd_qpskfe, 5000)) { + qpskEvent event; + int res = ioctl(fd_qpskfe, QPSK_GET_EVENT, &event); + if (res >= 0) + ChannelSynced = event.type == FE_COMPLETION_EV; + else + esyslog(LOG_ERR, "ERROR %d in qpsk get event", res); + } else - esyslog(LOG_ERR, "ERROR in qpsk get event"); + fprintf(stderr, "ERROR: timeout while tuning\n"); } else if (fd_qamfe >= 0) { // DVB-C @@ -2120,14 +2128,16 @@ bool cDvbApi::SetChannel(int ChannelNumber, int FrequencyMHz, char Polarization, // Wait for channel sync: - qamEvent event; - int res = ioctl(fd_qamfe, QAM_GET_EVENT, &event); - if (res == -EBUFFEROVERFLOW) - res = ioctl(fd_qamfe, QAM_GET_EVENT, &event); - if (res >= 0) - ChannelSynced = event.type == FE_COMPLETION_EV; + if (cFile::FileReady(fd_qamfe, 5000)) { + qamEvent event; + int res = ioctl(fd_qamfe, QAM_GET_EVENT, &event); + if (res >= 0) + ChannelSynced = event.type == FE_COMPLETION_EV; + else + esyslog(LOG_ERR, "ERROR %d in qam get event", res); + } else - esyslog(LOG_ERR, "ERROR in qam get event"); + fprintf(stderr, "ERROR: timeout while tuning\n"); } else { esyslog(LOG_ERR, "ERROR: attempt to set channel without DVB-S or DVB-C device"); |