Re: [PATCH] dynamically sized ringbuffers v2

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

 



On 05/10/07 01:55, Artur Skawina wrote:
> Auto sized ringbuffers, changes since v1:
> ...
> diff --git a/recorder.c b/recorder.c
> index 8bb1621..3c0e002 100644
> --- a/recorder.c
> +++ b/recorder.c
> @@ -157,8 +157,20 @@ void cRecorder::Receive(uchar *Data, int Length)
>  {
>    if (Running()) {
>       int p = ringBuffer->Put(Data, Length);
> -     if (p != Length && Running())
> +     if (p != Length && Running()) {
> +        for (int ms=20; ms<1000; ms+=ms) {
> +           cCondWait::SleepMs(ms);
> +           if (!Running())
> +              return;
> +           int r = ringBuffer->Put(Data+p, Length-p);
> +           p += r;
> +           if (r)
> +              dsyslog("saved extra %d bytes in recorder ring buffer after %d ms delay", r, ms);
> +           if (p == Length || !Running())
> +              return;
> +           }
>          ringBuffer->ReportOverflow(Length - p);
> +        }
>       }
>  }

If this "auto sized ringbuffers" change (which, from what I can
see so far - haven't tried it myself - looks like a good idea)
is ever to make its way into the official VDR source, you'll need
to get rid of the above waiting. It says in receiver.h:

  ...the call must return as soon as possible, without any unnecessary delay.

Maybe I should change this to

  ...the call  must return immediately.

Klaus

_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux