summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-27 19:23:19 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2008-01-27 19:23:19 +0000
commitd943a3f10f8716e41668878be3e4cb5fe716701d (patch)
tree863aa137822543446a77a5cdf24cf740d3f0d5e4 /lib
parent21871e8d17385885961c9b0319757f259bdb6f74 (diff)
downloadampache-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')
-rw-r--r--lib/class/stream.class.php25
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