still not working
This commit is contained in:
parent
89973d7fd1
commit
08d1ae5113
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue