summaryrefslogtreecommitdiffstats
path: root/play/index.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-19 04:56:07 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-06-19 04:56:07 +0000
commitde0deca8541332971fe5cfa57b5343c7c4ee8542 (patch)
tree50c7d3bee3eedd5bad62f4ff325c36b563291e52 /play/index.php
parent97469b849f08d985e538379143f729b9c8fa72d4 (diff)
downloadampache-de0deca8541332971fe5cfa57b5343c7c4ee8542.tar.gz
ampache-de0deca8541332971fe5cfa57b5343c7c4ee8542.tar.bz2
ampache-de0deca8541332971fe5cfa57b5343c7c4ee8542.zip
fixed an issue with songs stopping a little early depending on the client you use
Diffstat (limited to 'play/index.php')
-rw-r--r--play/index.php20
1 files changed, 14 insertions, 6 deletions
diff --git a/play/index.php b/play/index.php
index 9b4ee45e..3bef1226 100644
--- a/play/index.php
+++ b/play/index.php
@@ -220,6 +220,16 @@ if (!is_resource($fp)) {
}
} // else not downsampling
+// We need to check to see if they are rate limited
+$chunk_size = '8192';
+
+if ($GLOBALS['user']->prefs['rate_limit'] > 0) {
+ $chunk_size = $GLOBALS['user']->prefs['rate_limit'];
+}
+
+// Attempted fix, pimp up the size a bit
+$song->size = $song->size + ($chunk_size*2);
+
if ($start) {
debug_event('seek','Content-Range header recieved, skipping ahead ' . $start . ' bytes out of ' . $song->size,'5');
$browser->downloadHeaders($song_name, $song->mime, false, $song->size);
@@ -245,12 +255,7 @@ else {
$bytesStreamed = $start;
$minBytesStreamed = $song->size / 2;
-// We need to check to see if they are rate limited
-$chunk_size = '8192';
-
-if ($GLOBALS['user']->prefs['rate_limit'] > 0) {
- $chunk_size = $GLOBALS['user']->prefs['rate_limit'];
-}
+
// Actually do the streaming
while (!feof($fp) && (connection_status() == 0)) {
@@ -284,4 +289,7 @@ else {
@fclose($fp);
}
+// Note that the stream has ended
+debug_event('stream','Stream Ended at ' . $bytesStreamed . ' bytes out of ' . $song->size,'5');
+
?>