diff options
Diffstat (limited to 'music.cpp')
-rw-r--r-- | music.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); |