nope
parent
08d1ae5113
commit
915d21eff2
|
@ -514,12 +514,11 @@ function getCoverArt(req::Dict)
|
||||||
end
|
end
|
||||||
|
|
||||||
function giveconverted(file, bitrate, format)
|
function giveconverted(file, bitrate, format)
|
||||||
(iodata, proc) = convert(file, bitrate = bitrate, format = format)
|
iodata = convert(file, bitrate = bitrate, format = format)
|
||||||
headers = Dict{String,String}()
|
headers = Dict{String,String}()
|
||||||
suffix = format
|
suffix = format
|
||||||
mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] : suffix
|
mime = suffix in keys(Mux.mimetypes) ? Mux.mimetypes[suffix] : suffix
|
||||||
headers["Content-Type"] = mime
|
headers["Content-Type"] = mime
|
||||||
wait(proc)
|
|
||||||
# headers["Content-Length"] = string(length(data))
|
# headers["Content-Length"] = string(length(data))
|
||||||
return Dict(:body => read(iodata), :headers => headers)
|
return Dict(:body => read(iodata), :headers => headers)
|
||||||
end
|
end
|
||||||
|
@ -528,8 +527,8 @@ 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, p)
|
io
|
||||||
end
|
end
|
||||||
|
|
||||||
canstream(u::User) = u.stream
|
canstream(u::User) = u.stream
|
||||||
|
|
Loading…
Reference in New Issue