diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-01-27 19:23:19 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-01-27 19:23:19 +0000 |
commit | d943a3f10f8716e41668878be3e4cb5fe716701d (patch) | |
tree | 863aa137822543446a77a5cdf24cf740d3f0d5e4 /lib/class/stream.class.php | |
parent | 21871e8d17385885961c9b0319757f259bdb6f74 (diff) | |
download | ampache-d943a3f10f8716e41668878be3e4cb5fe716701d.tar.gz ampache-d943a3f10f8716e41668878be3e4cb5fe716701d.tar.bz2 ampache-d943a3f10f8716e41668878be3e4cb5fe716701d.zip |
adjust the bitrate validation and only force it to be whole bytes
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r-- | lib/class/stream.class.php | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 71fd4626..ba55c601 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -626,34 +626,9 @@ class Stream { */ public static function validate_bitrate($bitrate) { - // Setup an array of valid bitrates for Lame (yea yea, others might be different :P) - $valid_rate = array('32','40','56','64','80','96','112','128','160','192','224','256','320'); - /* Round to standard bitrates */ $sample_rate = 8*(floor($bitrate/8)); - if (in_array($sample_rate,$valid_rate)) { - return $sample_rate; - } - - /* See if it's less than the lowest one */ - if ($sample_rate < $valid_rate['0']) { - return $valid_rate['0']; - } - - /* Check to see if it's over 320 */ - if ($sample_rate > 320) { - return '320'; - } - - foreach ($valid_rate as $key=>$rate) { - $next_key = $key+1; - - if ($sample_rate > $rate AND $sample_rate < $valid_rate[$next_key]) { - return $rate; - } - } // end foreach - } // validate_bitrate |