revert again

This commit is contained in:
nixo 2019-05-21 19:40:34 +02:00
parent 3d55b8afa6
commit 7a73457e53
1 changed files with 4 additions and 4 deletions

View File

@ -520,9 +520,9 @@ function giveconverted(file, bitrate, format)
mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] : mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] :
"application/octet-stream" "application/octet-stream"
headers["Content-Type"] = mime headers["Content-Type"] = mime
# data = take!(iodata) data = take!(iodata)
# headers["Content-Length"] = string(length(data)) headers["Content-Length"] = string(length(data))
return Dict(:body => iodata, return Dict(:body => data,
:headers => headers, :headers => headers,
:file => join([split(basename(file), '.')[1:end-1], :file => join([split(basename(file), '.')[1:end-1],
".oga"],"")) ".oga"],""))
@ -532,7 +532,7 @@ function convert(infile; bitrate = 64, format = "oga")
global ffmpeg_threads global ffmpeg_threads
io = IOBuffer() io = IOBuffer()
p = run(pipeline(`ffmpeg -i $infile -y -c:a libvorbis -b:a $(bitrate)k -threads $(ffmpeg_threads) -f $format pipe:1`, p = run(pipeline(`ffmpeg -i $infile -y -c:a libvorbis -b:a $(bitrate)k -threads $(ffmpeg_threads) -f $format pipe:1`,
stderr=devnull, stdout=io), wait = false) stderr=devnull, stdout=io), wait = true)
io io
end end