[Slim-Checkins] r10281 - in /branches/6.5/server/Slim/Player:
Source.pm Squeezebox.pm
andy at svn.slimdevices.com
andy at svn.slimdevices.com
Tue Oct 10 18:20:40 PDT 2006
Author: andy
Date: Tue Oct 10 18:20:39 2006
New Revision: 10281
URL: http://svn.slimdevices.com?rev=10281&view=rev
Log:
Change rebuffering threshold to use the same value we use for quickstart. Don't rebuffer for Softsqueeze since it doesn't report fullness the same as hardware players.
Modified:
branches/6.5/server/Slim/Player/Source.pm
branches/6.5/server/Slim/Player/Squeezebox.pm
Modified: branches/6.5/server/Slim/Player/Source.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Player/Source.pm?rev=10281&r1=10280&r2=10281&view=diff
==============================================================================
--- branches/6.5/server/Slim/Player/Source.pm (original)
+++ branches/6.5/server/Slim/Player/Source.pm Tue Oct 10 18:20:39 2006
@@ -636,14 +636,25 @@
return;
}
- # If a stream falls to below 1% buffer fullness and we
- # have played at least 10 seconds, rebuffer the stream
- my $fullness = int( Slim::Networking::Slimproto::fullness($client) / $client->bufferSize() * 100);
-
+ # Softsqueeze doesn't report buffer fullness the same as hardware
+ if ( $client->isa('Slim::Player::SoftSqueeze') ) {
+ return;
+ }
+
+ my $fullness = $client->bufferFullness();
my $songTime = songTime($client);
- if ( $fullness <= 1 && $songTime > 10 ) {
- $::d_source && msg("Buffer fullness dropped to $fullness%, pausing to rebuffer\n");
+ # We want the buffer to contain the same amount of data required by quickstart
+ my $threshold = 20 * 1024;
+
+ # If we know the bitrate of the stream, we instead buffer a certain number of seconds of audio
+ if ( my $bitrate = Slim::Music::Info::getBitrate($url) ) {
+ my $bufferSecs = Slim::Utils::Prefs::get('bufferSecs') || 3;
+ $threshold = int($bitrate / 8) * $bufferSecs;
+ }
+
+ if ( $fullness < $threshold && $songTime > 10 ) {
+ $::d_source && msg("Buffered audio dropped to $fullness bytes, pausing to rebuffer\n");
$client->pause();
@@ -652,7 +663,7 @@
$client,
Time::HiRes::time() + 0.125,
\&Slim::Player::Squeezebox::quickstart,
- 5, # signals quickstart what percentage to rebuffer to
+ 1, # signals quickstart we are in rebuffering mode
);
}
}
Modified: branches/6.5/server/Slim/Player/Squeezebox.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Player/Squeezebox.pm?rev=10281&r1=10280&r2=10281&view=diff
==============================================================================
--- branches/6.5/server/Slim/Player/Squeezebox.pm (original)
+++ branches/6.5/server/Slim/Player/Squeezebox.pm Tue Oct 10 18:20:39 2006
@@ -247,14 +247,7 @@
$threshold = int($bitrate / 8) * $bufferSecs;
}
- if ( $rebuffer ) {
- # Change the threshold to a precentage of buffer size
- $threshold = int( $client->bufferSize() * ( $rebuffer / 100 ) );
- $::d_source && msg("Quickstart: Rebuffering to $rebuffer%... $fullness / $threshold\n");
- }
- else {
- $::d_source && msg("Quickstart: Buffering... $fullness / $threshold\n");
- }
+ $::d_source && msg("Quickstart: Buffering... $fullness / $threshold\n");
# Resume if we've hit the threshold, unless synced (sync unpauses all clients together)
if ( $fullness >= $threshold && !Slim::Player::Sync::isSynced($client) ) {
More information about the checkins
mailing list