method is_ready =
let r = self#length in
if buffering then begin
(* We have some data, but not enough for safely starting to play it. *)
if bufferize > 0 && r <= bufferize then
self#log#f 6 "Not ready: need more buffering (%i/%i)." r bufferize ;
r > bufferize
end else begin
(* This only happens if the end of track has not been played yet,
* after which the buffering phase will start again. Does not mean
* that we're not accumulating data, but it means that we don't know
* yet that we'll stop playing it until the buffer is full enough. *)
if r = 0 then
self#log#f 4 "Not ready for a new track: empty buffer." ;
r > 0
end