--- menu.c.bak Sun Jun 17 01:10:12 2007 +++ menu.c Sun Jun 17 01:10:14 2007 @@ -45,6 +45,8 @@ #define MINFREEDISK 300 // minimum free disk space (in MB) required to start recording #define NODISKSPACEDELTA 300 // seconds between "Not enough disk space to start recording!" messages +#define NOPIDDELTA 30 // seconds between refusing to start a recording with no PIDs. Like off-air channels in the UK. + #define CHNUMWIDTH (numdigits(Channels.MaxNumber()) + 1) // --- cMenuEditCaItem ------------------------------------------------------- @@ -3715,6 +3717,7 @@ bool cRecordControls::Start(cTimer *Timer, bool Pause) { static time_t LastNoDiskSpaceMessage = 0; + static time_t LastNoPIDCheck = 0; int FreeMB = 0; if (Timer) { AssertFreeDiskSpace(Timer->Priority(), !Timer->Pending()); @@ -3736,6 +3739,17 @@ cChannel *channel = Channels.GetByNumber(ch); if (channel) { + + // Check that at least one of the PIDs is non-zero. Else we'll get VDSBs when attempting to record an off-air channel... + if (!(channel->Vpid()||*channel->Apids()||*channel->Dpids()||*channel->Spids())) { + if (time(NULL) - LastNoPIDCheck > NOPIDDELTA) { + isyslog("All PIDs zero starting recording%s%s", Timer ? " timer " : "", Timer ? *Timer->ToDescr() : ""); + LastNoPIDCheck = time(NULL); + } + return false; + } + LastNoPIDCheck = 0; + int Priority = Timer ? Timer->Priority() : Pause ? Setup.PausePriority : Setup.DefaultPriority; cDevice *device = cDevice::GetDevice(channel, Priority, false); if (device) {