summaryrefslogtreecommitdiffstats
path: root/lib/stream.lib.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-29 21:32:03 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2006-12-29 21:32:03 +0000
commitec19be3ef82d41cfae99d555ce3eef7e162d74c9 (patch)
tree310499ac46d6de1a46a7aa3cecbea536299832bf /lib/stream.lib.php
parentddc3149e63c7a6da9b0feba9ec2663f1e4c96df4 (diff)
downloadampache-ec19be3ef82d41cfae99d555ce3eef7e162d74c9.tar.gz
ampache-ec19be3ef82d41cfae99d555ce3eef7e162d74c9.tar.bz2
ampache-ec19be3ef82d41cfae99d555ce3eef7e162d74c9.zip
fixed auto-transcoding logic, requires a third variable now if not transcoding to mp3
Diffstat (limited to 'lib/stream.lib.php')
-rw-r--r--lib/stream.lib.php15
1 files changed, 2 insertions, 13 deletions
diff --git a/lib/stream.lib.php b/lib/stream.lib.php
index 8049be8b..cb935aaf 100644
--- a/lib/stream.lib.php
+++ b/lib/stream.lib.php
@@ -122,6 +122,7 @@ function check_lock_songs($song_id) {
$db_results = mysql_query($sql, dbh());
if (mysql_num_rows($db_results)) {
+ debug_event('lock_songs','Song Already Playing, skipping...','5');
return false;
}
@@ -139,18 +140,6 @@ function check_lock_songs($song_id) {
*/
function start_downsample($song,$now_playing_id=0,$song_name=0) {
- /**
- * Extra check, for now hardcode it to mp3 but if
- * we are transcoding we need to fix the mime type
- * and let the user define what file type it's switching
- * to.
- */
- if (!$song->native_stream()) {
- $song->mime = 'audio/mpeg';
- $song_name = $song->f_artist_full . " - " . $song->title . ".mp3";
- }
-
-
/* Check to see if bitrates are set if so let's go ahead and optomize! */
$max_bitrate = conf('max_bit_rate');
$min_bitrate = conf('min_bit_rate');
@@ -252,7 +241,7 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) {
/* We need more than just the handle here */
$return_array['handle'] = $fp;
- $return_array['size'] = $sample_ration*$song->size;
+ $return_array['size'] = $sample_ratio*$song->size;
return ($return_array);