diff options
-rwxr-xr-x | docs/CHANGELOG | 2 | ||||
-rw-r--r-- | lib/stream.lib.php | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG index b61e6893..544c738f 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,8 @@ -------------------------------------------------------------------------- v.3.3.2 + - Fixed issue with transcoding not changing the mime type or the + filename, currently hardcodes to mp3 and audio/mpeg - Updated Spanish Translation (Thx Bgordon) - Fixed potential for a foreach() error on vainfo if no tags are found, and fixed quicktime (mp4) tag reading diff --git a/lib/stream.lib.php b/lib/stream.lib.php index 9b99d752..852df28a 100644 --- a/lib/stream.lib.php +++ b/lib/stream.lib.php @@ -133,6 +133,18 @@ 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'); @@ -216,6 +228,7 @@ function start_downsample($song,$now_playing_id=0,$song_name=0) { $sample_ratio = $sample_rate/($song->bitrate/1000); } + header("Content-Length: " . $sample_ratio*$song->size); $browser->downloadHeaders($song_name, $song->mime, false,$sample_ratio*$song->size); |