diff options
author | Paul Arthur <flowerysong00@yahoo.com> | 2013-01-21 13:20:54 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-23 13:09:27 -0500 |
commit | e1000558fb91250317403c7b75701029b7905ba0 (patch) | |
tree | e4f7c3bbee4f6221b2348dba4664982dd4cccea7 /lib/class/stream.class.php | |
parent | e387a4caaf2b596c76cc6ff91bb2334c9bbd81d7 (diff) | |
download | ampache-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.
Diffstat (limited to 'lib/class/stream.class.php')
-rw-r--r-- | lib/class/stream.class.php | 30 |
1 files changed, 2 insertions, 28 deletions
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 ); |