[Pkg-ocaml-maint-commits] [SCM] liquidsoap packaging branch, master, updated. debian/0.9.2-2-2-gf029f6a

Romain Beauxis toots at rastageeks.org
Mon Apr 12 02:43:26 UTC 2010


The following commit has been merged in the master branch:
commit f029f6aef3592cdf380e0f5e860dea51903a3b18
Author: Romain Beauxis <toots at rastageeks.org>
Date:   Mon Apr 12 04:33:56 2010 +0200

    Completed patch for input.lastfm

diff --git a/debian/patches/fix_lastfm_input.patch b/debian/patches/fix_lastfm_input.patch
index 7a68beb..bbf299a 100644
--- a/debian/patches/fix_lastfm_input.patch
+++ b/debian/patches/fix_lastfm_input.patch
@@ -1,8 +1,76 @@
 Index: liquidsoap/src/sources/lastfm_input.ml
 ===================================================================
---- liquidsoap.orig/src/sources/lastfm_input.ml	2010-04-12 04:14:38.000000000 +0200
-+++ liquidsoap/src/sources/lastfm_input.ml	2010-04-12 04:17:03.000000000 +0200
-@@ -164,8 +164,8 @@
+--- liquidsoap.orig/src/sources/lastfm_input.ml	2010-04-12 04:27:59.000000000 +0200
++++ liquidsoap/src/sources/lastfm_input.ml	2010-04-12 04:31:26.000000000 +0200
+@@ -26,6 +26,7 @@
+              ~bufferize ~timeout ~bind_address 
+              ~debug ~max ~user_agent ~audioscrobbler_host uri =
+ let playlist_mode = Http_source.First in
++let bufferize_time = Fmt.ticks_of_seconds bufferize in
+ object (self)
+   inherit Http_source.http ~playlist_mode ~poll_delay ~timeout 
+                            ~autostart ~bind_address ~bufferize 
+@@ -37,7 +38,14 @@
+ 
+   (* Called when there's no decoding process, in order to create one. *)
+   method connect url =
+-    try
++    (* Do nothing is the buffer is
++     * still greater than bufferize.
++     * This is not an active wait because
++     * the polling thread is timed. Hence,
++     * we do not need to put the thread to sleep. *)
++    if self#length > bufferize_time then ()
++    else
++     try
+       let login,station,options = Lastfm.Radio.parse uri in
+       let id = 
+         match session with
+@@ -109,6 +117,25 @@
+      end
+ end
+ 
++(** Values for max buffer and bufferize are
++  * tricky. Lastfm sends a burst of 10s of
++  * data at the beginning of the streaming.
++  * Hence, if we immediatly request the next
++  * track when the current tracks end, the
++  * burst sum-up and we end-up with 10 then
++  * 20 then 30... seconds in the buffer.
++  * Instead, we wait for the buffer to consume
++  * its data up-to bufferize and then request the
++  * next song.
++  * Good values for max and bufferize are then 25
++  * and 10. With these values, the initial buffer is
++  * 10 so we start streaming immediatly. When the
++  * first song ends, the buffer jumps from 10 to 20
++  * with the next burst. When the second song ends,
++  * the buffer is emptied up-to 10, then we request
++  * the next song and it jumps again to 20.
++  * After the second song, the buffer strategy becomes
++  * static, with an average buffer of 20s. *)
+ let () =
+     Lang.add_operator "input.lastfm"
+       ~category:Lang.Input
+@@ -116,7 +143,7 @@
+               "paused/resumed using the start/stop telnet commands.")
+       [ "autostart", Lang.bool_t, Some (Lang.bool true),
+         Some "Initially start relaying or not." ;
+-        "buffer", Lang.float_t, Some (Lang.float 2.),
++        "buffer", Lang.float_t, Some (Lang.float 10.),
+         Some "Duration of the pre-buffered data." ;
+         "bind_address", Lang.string_t, Some (Lang.string ""),
+         Some ("address to bind on the local machine. This option can be useful if " ^
+@@ -139,7 +166,7 @@
+         Some "Treat new metadata as new track." ;
+         "debug", Lang.bool_t, Some (Lang.bool false),
+         Some "Run in debugging mode by not catching some exceptions." ;
+-        "max", Lang.float_t, Some (Lang.float 10.),
++        "max", Lang.float_t, Some (Lang.float 25.),
+         Some "Maximum duration of the buffered data." ;
+        "user_agent", Lang.string_t,
+         Some (Lang.string
+@@ -164,8 +191,8 @@
               | s -> Some s
           in
           let user_agent = Lang.to_string (List.assoc "user_agent" p) in

-- 
liquidsoap packaging



More information about the Pkg-ocaml-maint-commits mailing list