summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Arthur <flowerysong00@yahoo.com>2013-01-21 13:20:54 -0500
committerPaul Arthur <paul.arthur@flowerysong.com>2013-01-23 13:09:27 -0500
commite1000558fb91250317403c7b75701029b7905ba0 (patch)
treee4f7c3bbee4f6221b2348dba4664982dd4cccea7
parente387a4caaf2b596c76cc6ff91bb2334c9bbd81d7 (diff)
downloadampache-e1000558fb91250317403c7b75701029b7905ba0.tar.gz
ampache-e1000558fb91250317403c7b75701029b7905ba0.tar.bz2
ampache-e1000558fb91250317403c7b75701029b7905ba0.zip
Tear the offset/eof/size crap out of Stream
Now that playback doesn't pretend it's supported, we don't need the fragile hacks to support guessing the content size or 'seeking' within a transcoded stream.
-rwxr-xr-xdocs/CHANGELOG3
-rw-r--r--lib/class/stream.class.php30
2 files changed, 5 insertions, 28 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index 79b36996..54f1fe27 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,9 @@
--------------------------------------------------------------------------
v.3.6-FUTURE
+ - Made transcoded streams more standards compliant by not sending a random
+ value as the Content-Length or claiming that ranged requests are
+ supported
- Changed rating semantics to distinguish between user ratings and the
global average and add the ability to search for unrated items
(< 1 star)
diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php
index 706dd0f5..1cac2d54 100644
--- a/lib/class/stream.class.php
+++ b/lib/class/stream.class.php
@@ -146,13 +146,14 @@ class Stream {
* to the song object is passed so that the changes we make in here
* affect the external object, References++
*/
- public static function start_transcode(&$song, $song_name = 0, $start = 0) {
+ public static function start_transcode(&$song, $song_name = 0) {
// Check to see if bitrates are set.
// If so let's go ahead and optimize!
$max_bitrate = Config::get('max_bit_rate');
$min_bitrate = Config::get('min_bit_rate');
$time = time();
+ // FIXME: This should be configurable for each output type
$user_sample_rate = Config::get('sample_rate');
if (!$song_name) {
@@ -207,27 +208,6 @@ class Stream {
$sample_rate = self::validate_bitrate($song->bitrate / 1000);
}
- // Set the new size for the song (in bytes)
- $song->size = floor($sample_rate * $song->time * 125);
-
- /* Get Offset */
- $offset = ($start * $song->time) / $song->size;
- $offsetmm = floor($offset / 60);
- $offsetss = floor($offset - ($offsetmm * 60));
- // If flac then format it slightly differently
- // HACK
- if ($song->transcoded_from == 'flac') {
- $offset = sprintf('%02d:%02d', $offsetmm, $offsetss);
- }
- else {
- $offset = sprintf('%02d.%02d', $offsetmm, $offsetss);
- }
-
- /* Get EOF */
- $eofmm = floor($song->time / 60);
- $eofss = floor($song->time - ($eofmm * 60));
- $eof = sprintf('%02d.%02d', $eofmm, $eofss);
-
$song_file = scrub_arg($song->file);
$transcode_command = $song->stream_cmd();
@@ -238,12 +218,6 @@ class Stream {
$string_map = array(
'%FILE%' => $song_file,
- '%OFFSET%' => $offset,
- '%OFFSET_MM%' => $offsetmm,
- '%OFFSET_SS%' => $offsetss,
- '%EOF%' => $eof,
- '%EOF_MM%' => $eofmm,
- '%EOF_SS%' => $eofss,
'%SAMPLE%' => $sample_rate
);