Author: ayoung
Date: Sat Jan 22 07:52:11 2011
New Revision: 9297

URL: http://svn.slimdevices.com/jive?rev=9297&view=rev
Log:
bug 16275: Rebuffering on 1st track 
For lossless formats (FLAC, ALAC, PCM), if the buffer threshold is set to the 
default of 255KiB then increase this to 1MB. This may result in increased 
startup latency in the case of slow networks but that is preferable to 
stuttering after startup. 1MB should give about 10s of buffered data for FLAC 
at 44100/16/2 and perhaps 4s for 96000/24/2.

Modified:
    7.6/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua

Modified: 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua
URL: 
http://svn.slimdevices.com/jive/7.6/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua?rev=9297&r1=9296&r2=9297&view=diff
==============================================================================
--- 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua 
(original)
+++ 7.6/trunk/squeezeplay/src/squeezeplay/share/jive/audio/Playback.lua Sat Jan 
22 07:52:11 2011
@@ -638,10 +638,23 @@
                self.ignoreStream = false
                self.decodeThreshold = 2048
 
-               -- Except for Vorbis, where we should use the buffer threshold 
value
-               -- Even this may not be enough for files with large comments...
                if self.mode == 'o' then
+                       -- For Vorbis, where we should use the buffer threshold 
value
+                       -- Even this may not be enough for files with large 
comments...
                        self.decodeThreshold = self.threshold
+               
+               elseif self.threshold > (254 * 1024) and (self.mode == 'f' or 
self.mode == 'p' or self.mode == 'l') then 
+                       -- For lossless (high bit-rate) formats, lets try to 
get a much bigger chunk so that
+                       -- any server-side delay in streaming caused by 
playlist updates, etc., do not cause undue problems.
+                       --
+                       -- For a network operating at 5Mb/s, 1MB => 2s. That is 
probably the maximum acceptable delay,
+                       -- and gives us 4 times as much buffered data. 
+                       --
+                       -- For a radio stream transcoded to FLAC (50% 
compression) from 44100/16/2, 1MB => 11s
+                       -- which is a long time but this should not generally 
happen because self.threshold should be < 255KiB
+                       -- in that case.
+                       
+                       self.threshold = 1000000
                end
 
                if self.flags & 0x10 ~= 0 then

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins

Reply via email to