Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Overlapping timers on one channel



Jaakko Hyvätti wrote:
> 
>   Hi Klaus,
> 
>   If I disable DO_MULTIPLE_RECORDINGS, as I have to with my DVB-C card,
> vdr also refuses to record the same channel to two files.  This happens
> when there are two overlapping timers on the same channel. 1.1.19
> behaviour is that two DVB cards are needed to record these overlapping
> programs.
> 
>   The patch below moves the #ifdef's a bit.  It enables again the code to
> detect if the current recording channel is the same as the new one.  I
> think this is correct even if DO_MULTIPLE_RECORDINGS is disabled, as it
> does not involve enabling 'OTHER' pid's or transfer mode or anything that
> might crash the arm.  Am I correct here?
> 
> Regards
> Jaakko
> 
> diff -ru old/vdr-1.1.19/dvbdevice.c vdr-1.1.19/dvbdevice.c
> --- old/vdr-1.1.19/dvbdevice.c  Sat Dec  7 16:50:46 2002
> +++ vdr-1.1.19/dvbdevice.c      Fri Dec 13 08:16:02 2002
> @@ -537,11 +537,11 @@
>    bool needsDetachReceivers = true;
> 
>    if (ProvidesSource(Channel->Source()) && ProvidesCa(Channel->Ca())) {
> -#ifdef DO_MULTIPLE_RECORDINGS
>       if (Receiving()) {
>          if (dvbTuner->IsTunedTo(Channel)) {
>             needsDetachReceivers = false;
>             if (!HasPid(Channel->Vpid())) {
> +#ifdef DO_MULTIPLE_RECORDINGS
>                if (Channel->Ca() > CACONFBASE) {
>                   needsDetachReceivers = true;
>                   result = hasPriority;
> @@ -552,6 +552,9 @@
>                else
>                   result = Priority >= Setup.PrimaryLimit;
>  #endif
> +#else
> +             result = hasPriority;
> +#endif
>                }
>             else
>                result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
> @@ -560,7 +563,6 @@
>             result = hasPriority;
>          }
>       else
> -#endif
>          result = hasPriority;
>       }
>    if (NeedsDetachReceivers)

Thanks, that's true.
After taking a closer look at this I believe this function can be made
even a little shorter, like this:

bool cDvbDevice::ProvidesChannel(const cChannel *Channel, int Priority, bool *NeedsDetachReceivers) const
{
  bool result = false;
  bool hasPriority = Priority < 0 || Priority > this->Priority();
  bool needsDetachReceivers = true;

  if (ProvidesSource(Channel->Source()) && ProvidesCa(Channel->Ca())) {
     result = hasPriority;
     if (Receiving()) {
        if (dvbTuner->IsTunedTo(Channel)) {
           needsDetachReceivers = false;
           if (!HasPid(Channel->Vpid())) {
#ifdef DO_MULTIPLE_RECORDINGS
              if (Channel->Ca() > CACONFBASE)
                 needsDetachReceivers = true;
              else if (!IsPrimaryDevice())
                 result = true;
#ifdef DO_REC_AND_PLAY_ON_PRIMARY_DEVICE
              else
                 result = Priority >= Setup.PrimaryLimit;
#endif
#endif
              }
           else
              result = !IsPrimaryDevice() || Priority >= Setup.PrimaryLimit;
           }
        }
     }
  if (NeedsDetachReceivers)
     *NeedsDetachReceivers = needsDetachReceivers;
  return result;
}

Maybe you'd like to test this one...

Klaus
-- 
_______________________________________________________________

Klaus Schmidinger                       Phone: +49-8635-6989-10
CadSoft Computer GmbH                   Fax:   +49-8635-6989-40
Hofmark 2                               Email:   kls@cadsoft.de
D-84568 Pleiskirchen, Germany           URL:     www.cadsoft.de
_______________________________________________________________


--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index