fixes field acess error when printing other errors

This commit is contained in:
Spencer Russell 2019-02-27 09:01:09 -05:00
parent c66ad398bd
commit 8bd884d394

View file

@ -296,7 +296,7 @@ function handle_errors(stream::PortAudioStream)
nread = read!(stream.errbuf, err) nread = read!(stream.errbuf, err)
nread == 1 || break nread == 1 || break
if err[1] == PA_SHIM_ERRMSG_ERR_OVERFLOW if err[1] == PA_SHIM_ERRMSG_ERR_OVERFLOW
warn("Error buffer overflowed on stream $(stream.name)") warn("Error buffer overflowed on portaudio stream")
elseif err[1] == PA_SHIM_ERRMSG_OVERFLOW elseif err[1] == PA_SHIM_ERRMSG_OVERFLOW
# warn("Input overflowed from $(name(stream.source))") # warn("Input overflowed from $(name(stream.source))")
elseif err[1] == PA_SHIM_ERRMSG_UNDERFLOW elseif err[1] == PA_SHIM_ERRMSG_UNDERFLOW
@ -304,7 +304,7 @@ function handle_errors(stream::PortAudioStream)
else else
error(""" error("""
Got unrecognized error code $(err[1]) from audio thread for Got unrecognized error code $(err[1]) from audio thread for
stream "$(stream.name)". Please file an issue at portaudio stream. Please file an issue at
https://github.com/juliaaudio/portaudio.jl/issues""") https://github.com/juliaaudio/portaudio.jl/issues""")
end end
end end