diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-24 00:25:33 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-06-24 00:25:33 +0000 |
commit | 8e6cd377be0a7f4a569c54316bdb882a714e2c7c (patch) | |
tree | 610ffe6303d907aea37ce4f766a3cc70b6248b0c | |
parent | 51f91c7b345cc90e742333976fa464d316a41283 (diff) | |
download | ampache-8e6cd377be0a7f4a569c54316bdb882a714e2c7c.tar.gz ampache-8e6cd377be0a7f4a569c54316bdb882a714e2c7c.tar.bz2 ampache-8e6cd377be0a7f4a569c54316bdb882a714e2c7c.zip |
tweaked transcode stuff so that it acutally changes the file name and mime type semi-correctly
-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); |