[Slim-Checkins] r10289 - /branches/6.5/server/Slim/Player/Player.pm

andy at svn.slimdevices.com andy at svn.slimdevices.com
Wed Oct 11 08:24:25 PDT 2006


Author: andy
Date: Wed Oct 11 08:24:24 2006
New Revision: 10289

URL: http://svn.slimdevices.com?rev=10289&view=rev
Log:
In buffer fullness mode on remote streams, display the number of seconds of audio in the buffer instead of a percentage

Modified:
    branches/6.5/server/Slim/Player/Player.pm

Modified: branches/6.5/server/Slim/Player/Player.pm
URL: http://svn.slimdevices.com/branches/6.5/server/Slim/Player/Player.pm?rev=10289&r1=10288&r2=10289&view=diff
==============================================================================
--- branches/6.5/server/Slim/Player/Player.pm (original)
+++ branches/6.5/server/Slim/Player/Player.pm Wed Oct 11 08:24:24 2006
@@ -660,6 +660,16 @@
 	
 	if ($showFullness) {
 		$songtime = ' ' . int($fractioncomplete * 100 + 0.5)."%";
+		
+		# for remote streams where we know the bitrate, 
+		# show the number of seconds of audio in the buffer instead of a percentage
+		my $url = Slim::Player::Playlist::url($client);
+		if ( Slim::Music::Info::isRemoteURL($url) ) {
+			if ( my $bitrate = Slim::Music::Info::getBitrate($url) ) {
+				$songtime  = ' ' . sprintf( "%.1f", $client->bufferFullness() / ( int($bitrate / 8) ) );
+				$songtime .= ' ' . $client->string('SECONDS');
+			}
+		}
 	} elsif ($showTime) { 
 		$songtime = ' ' . $client->textSongTime($showTime < 0);
 	}



More information about the checkins mailing list