summaryrefslogtreecommitdiff
path: root/music.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'music.cpp')
-rw-r--r--music.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/music.cpp b/music.cpp
index ec2f537..9892526 100644
--- a/music.cpp
+++ b/music.cpp
@@ -132,16 +132,15 @@ void MusicTrack::render(HTTP::Connection::p req, HTTPResponse& res) {
Tag *t = new ID3Tag(path.string());
delete t;
- fs::ifstream is(path, std::ios::binary | std::ios::in);
-
if(req->args.count("decoder") && req->args.count("encoder")) {
DecoderBase *d = decoder::get_decoder(req->args["decoder"]);
EncoderBase *e = encoder::get_encoder(req->args["encoder"]);
- Transcoder t(is, res, *d, *e);
+ Transcoder t(path.string(), res, *d, *e);
t.run();
delete d;
delete e;
} else {
+ fs::ifstream is(path, std::ios::in | std::ios::binary);
is.seekg(0, std::ios::end);
res.add_header("content-length", boost::str(boost::format("%d") % is.tellg()));
is.seekg(0, std::ios::beg);