1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-03 09:49:30 +02:00

few tweaks for flash player and a fixed for downsampleing

This commit is contained in:
Karl 'vollmerk' Vollmer 2006-10-30 07:18:46 +00:00
parent 598a200b96
commit 49c1cefcb9
5 changed files with 16 additions and 20 deletions

View file

@ -4,6 +4,9 @@
--------------------------------------------------------------------------
v.3.3.3-Alpha2
- Fixed a problem were invalid bitrates below the set downsample
bitrate could cause lame to crash as they weren't
validated.
- Added XSPF Flash player, rough around the edges but it works
(Thx pb1dft/GrinningArmor)
- Fixed bug with Album --> Artist sorting, wasn't allowing you to

View file

@ -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'];

View file

@ -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 "<select name=\"$name\">\n";
echo "\t<option value=\"\">" . _('None') . "</option>\n";
@ -280,6 +281,7 @@ function create_preference_input($name,$value) {
if (conf('allow_localplay_playback')) {
echo "\t<option value=\"localplay\" $is_local>" . _('Localplay') . "</option>\n";
}
echo "\t<option value=\"xspf_player\" $is_xspf_player>" . _('XSPF Player') . "</option>\n";
echo "</select>\n";
break;
case 'playlist_type':
@ -292,7 +294,6 @@ function create_preference_input($name,$value) {
echo "\t<option value=\"asx\" $asx_type>" . _('Asx') . "</option>\n";
echo "\t<option value=\"ram\" $ram_type>" . _('RAM') . "</option>\n";
echo "\t<option value=\"xspf\" $xspf_type>" . _('XSPF') . "</option>\n";
echo "\t<option value=\"xspf_player\">" . _('Flash') . "</option>\n";
echo "</select>\n";
break;
case 'lang':

View file

@ -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 {

View file

@ -129,8 +129,15 @@ switch ($method) {
default:
$stream_type = conf('playlist_type');
if ($GLOBALS['user']->prefs['play_type'] != "stream" AND $GLOBALS['user']->prefs['play_type'] != "downsample") {
$stream_type = $GLOBALS['user']->prefs['play_type'];
/* For non-stream/downsample methos we need to so something else */
switch ($GLOBALS['user']->prefs['play_type']) {
case 'stream':
case 'downsample':
// Rien a faire
break;
default:
$stream_type = $GLOBALS['user']->prefs['play_type'];
break;
}
/* Start the Stream */