diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-10-10 07:48:41 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-10-10 07:48:41 +0000 |
commit | f5a47635bd7b3d4b3c12f0f6f42424316a074e71 (patch) | |
tree | d3019a7bec6003b1ca9cb1aee768162dffc9d6a8 /play/index.php | |
parent | 8ae3734bde5ad47fb0dd4a53b59bdd3cef57d7e2 (diff) | |
download | ampache-f5a47635bd7b3d4b3c12f0f6f42424316a074e71.tar.gz ampache-f5a47635bd7b3d4b3c12f0f6f42424316a074e71.tar.bz2 ampache-f5a47635bd7b3d4b3c12f0f6f42424316a074e71.zip |
really fixed downsampling.... :S
Diffstat (limited to 'play/index.php')
-rw-r--r-- | play/index.php | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/play/index.php b/play/index.php index 3d700678..72bd18e0 100644 --- a/play/index.php +++ b/play/index.php @@ -250,10 +250,7 @@ if (Config::get('access_control') AND Config::get('downsample_remote')) { // If they are downsampling, or if the song is not a native stream or it's non-local if (($GLOBALS['user']->prefs['transcode'] == 'always' || !$song->native_stream() || $not_local) && $GLOBALS['user']->prefs['transcode'] != 'never') { debug_event('downsample','Starting Downsample...','5'); - $results = Stream::start_downsample($song,$lastid,$song_name); - $fp = $results['handle']; - $song->size = $results['size']; - + $fp = Stream::start_downsample($song,$lastid,$song_name); } // end if downsampling else { // Send file, possible at a byte offset @@ -265,12 +262,6 @@ else { } } // else not downsampling -// We need to check to see if they are rate limited -$chunk_size = '2084'; - -// Attempted fix, pimp up the size a bit -$song->size = $song->size; - // Put this song in the now_playing table insert_now_playing($song->id,$uid,$song->time,$sid); @@ -300,9 +291,9 @@ $minBytesStreamed = $song->size / 2; // Actually do the streaming do { - $buf = fread($fp, $chunk_size); + $buf = fread($fp, 2048); print($buf); - $bytesStreamed += $chunk_size; + $bytesStreamed += 2048; } while (!feof($fp) && (connection_status() == 0)); // Make sure that a good chunk of the song has been played |