Closed mightbecharles closed 1 year ago
Ah, this is a really good catch. While communicate()
would be a problem for reading the actual output data from a "proper" invocation of ffmpeg, it actually seems like exactly the right thing for the ffdec.available()
case.
In short, the problem with wait()
, as currently written, is that the subprocess may fill up its output buffers—at which point it hangs, waiting for us (audioread) to consume something from those pipes. We're waiting for the ffmpeg process to exit, so that's a classic deadlock scenario.
I think we should use your change! Any chance you could submit a very small PR to this effect?
@sampsyo Thanks, let me know if there are any problems!
I am using Librosa-0.9.2 on a project and encountered this issue with audioread-3.0.0.
Librosa calls
available_backends()
, which callsffdec.available()
available()
seems to hang indefinitely. But changingproc.wait()
toproc.communicate()
seems to fix the issue for my use case.I saw in #113 that
communicate()
wasn't ideal, so maybe there's something else worth looking into?