--- menu.c.bak Sat Jun 16 23:41:27 2007 +++ menu.c Sun Jun 17 00:42:55 2007 @@ -39,6 +39,8 @@ #define MINFREEDISK 300 // minimum free disk space 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 ------------------------------------------------------- @@ -3577,6 +3579,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()); @@ -3599,6 +3602,17 @@ if (channel) { bool NeedsDetachReceivers = false; + + // 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, &NeedsDetachReceivers); if (device) {