Hey,

Thanks for the clarification, I understand the situation a bit better now.

On Mon, Jul 20, 2009 at 1:38 AM, Gabriel Afana<[email protected]> wrote:
> make much sense.  Let me try again.  When using request.dynamic, liquidsoap
> queues the next track immediately after starting the currently queued
> track.  However, it seems that after playing long tracks (30 minutes+),
> liquidsoap will not queue the next track immediately after the currently
> queued track starts.  Instead, liquidsoap waits until several seconds before
> the end that track (the long 30 minute+ track) before it will queue the next
> track.  This is where the problem is.

Here's a possible explanation: liquidsoap uses a remaining time
_estimation_, based on the ratio between decoded PCM data and consumed
encoded data. This estimation is often pretty wrong at the beginning
of a track but converges to something good at the end. It is possible
that for most files, it starts being quite low, so the next track is
prefetched, but only for very long tracks it is long at the beginning
and hence the prefetching gets delayed properly.

I wonder if this theory explains your observation. It would not apply
anymore in conservative mode -- please precise if you use it in your
observations. I wrote a quick patch to see the figures. It uses printf
to display the first two estimations, it's intended for use with
"liquidsoap -r some.mp3/ogg" but should normally also work with files
being loaded in a running liquidsoap (with stdout redirected to the
logs in daemon mode).

Index: src/decoder.ml
===================================================================
--- src/decoder.ml      (revision 6722)
+++ src/decoder.ml      (working copy)
@@ -76,6 +76,10 @@
          log#f 4 "Trying %s decoder for %S..." format filename ;
          match decoder filename with
            | Some d ->
+               Printf.printf "Initial remaining time estimation: %.2f.\n%!"
+                 (Fmt.seconds_of_ticks (d.fill (Frame.make ()))) ;
+               Printf.printf "Second remaining time estimation: %.2f.\n%!"
+                 (Fmt.seconds_of_ticks (d.fill (Frame.make ()))) ;
                d.close () ;
                log#f 3 "Decoder %s chosen for %S." format filename ;
                raise (Exit (format,decoder))

I just tested it on some mp3 file:
$ src/liquidsoap -r some.mp3
Initial remaining time estimation: 141.67.
Second remaining time estimation: 142.37.
Request resolved.
title="..."
...
Computing duration: 144.22 sec.

No big difference here, tends to invalidate my explanation... Anyway,
does that help you observe anything new?
-- 
David

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to