still not working

This commit is contained in:
nixo 2019-05-21 19:12:15 +02:00
parent 89973d7fd1
commit 08d1ae5113
1 changed files with 4 additions and 4 deletions

View File

@ -514,12 +514,12 @@ function getCoverArt(req::Dict)
end
function giveconverted(file, bitrate, format)
iodata = convert(file, bitrate = bitrate, format = format)
(iodata, proc) = convert(file, bitrate = bitrate, format = format)
headers = Dict{String,String}()
suffix = format
mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] : suffix
headers["Content-Type"] = mime
wait(iodata)
wait(proc)
# headers["Content-Length"] = string(length(data))
return Dict(:body => read(iodata), :headers => headers)
end
@ -527,9 +527,9 @@ end
function convert(infile; bitrate = 64, format = "oga")
global ffmpeg_threads
io = IOBuffer()
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)
io
(io, p)
end
canstream(u::User) = u.stream