From 49c1cefcb9a2dc3f81d868655e64d2e357750f9d Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Mon, 30 Oct 2006 07:18:46 +0000 Subject: few tweaks for flash player and a fixed for downsampleing --- lib/init.php | 2 +- lib/preferences.php | 3 ++- lib/stream.lib.php | 17 +---------------- 3 files changed, 4 insertions(+), 18 deletions(-) (limited to 'lib') diff --git a/lib/init.php b/lib/init.php index ae4cabbd..d54706b7 100644 --- a/lib/init.php +++ b/lib/init.php @@ -73,7 +73,7 @@ if (!$results = read_config($configfile,0)) { } /** This is the version.... fluf nothing more... **/ -$results['version'] = '3.3.3-Alpha2 Build (001)'; +$results['version'] = '3.3.3-Alpha2 Build (002)'; $results['raw_web_path'] = $results['web_path']; $results['web_path'] = $http_type . $_SERVER['HTTP_HOST'] . $results['web_path']; diff --git a/lib/preferences.php b/lib/preferences.php index 0022911b..d3c8ce63 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -265,6 +265,7 @@ function create_preference_input($name,$value) { if ($value == 'downsample') { $is_down = 'selected="selected"'; } elseif ($value == 'localplay') { $is_local = 'selected="selected"'; } elseif ($value == 'democratic') { $is_vote = 'selected="selected"'; } + elseif ($value == 'xspf_player') { $is_xspf_player = 'selected="selected"'; } else { $is_stream = "selected=\"selected\""; } echo "\n"; break; case 'playlist_type': @@ -292,7 +294,6 @@ function create_preference_input($name,$value) { echo "\t\n"; echo "\t\n"; echo "\t\n"; - echo "\t\n"; echo "\n"; break; case 'lang': diff --git a/lib/stream.lib.php b/lib/stream.lib.php index bc30d7cb..bd306c48 100644 --- a/lib/stream.lib.php +++ b/lib/stream.lib.php @@ -160,21 +160,6 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) { if ($max_bitrate > 1 AND $min_bitrate < $max_bitrate) { $last_seen_time = $time - 1200; //20 min. - /********************************** - * Commenting out the following, I'd rather have it slightly less accurate and avoid a 4 table join - // Count the users connected in the last 20 min using downsampling - $sql = "SELECT COUNT(DISTINCT session.username) FROM session,user,user_preference,preferences " . - "WHERE user.username = session.username AND session.expire > '$time' AND user.last_seen > $last_seen_time " . - "AND preferences.name = 'play_type' AND user_preference.preference = preferences.id AND " . - "user_preference.user = user.username AND user_preference.value='downsample'"; - $db_result = mysql_query($sql, $dbh); - $results = mysql_fetch_row($db_result); - - // The current number of connected users - $current_users_count = $results[0]; - ************************************/ - - $sql = "SELECT COUNT(*) FROM now_playing, user_preference, preferences " . "WHERE preferences.name = 'play_type' AND user_preference.preference = preferences.id " . "AND now_playing.user = user_preference.user AND user_preference.value='downsample'"; @@ -220,7 +205,7 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) { /* Never Upsample a song */ if (($sample_rate*1000) > $song->bitrate) { - $sample_rate = $song->bitrate/1000; + $sample_rate = validate_bitrate($song->bitrate)/1000; $sample_ratio = '1'; } else { -- cgit