beetbox / audioread

cross-library (GStreamer + Core Audio + MAD + FFmpeg) audio decoding for Python
MIT License
481 stars 108 forks source link

Close file handles in ffdec.py #68

Closed RyanMarcus closed 6 years ago

RyanMarcus commented 6 years ago

Hello!

Thanks for all the hard work putting this library together! It made quickly combining two audio files I had super easy.

This PR just closes the /dev/null, stdout, and stderr FDs when in FFmpeg mode to avoid resource leak warnings.

Let me know if there are any issues,

Ryan

sampsyo commented 6 years ago

So we can refer back to it later, what sort of resource leak warnings were you getting? Are they Python messages? Or something from ffmpeg?

RyanMarcus commented 6 years ago

The errors were Python errors, coming from an execution of a unit test with python3 -m unittest. I think it enables these sorts of warning if an FD is left open after a test finishes.

I will copy/paste an error later tonight.

sampsyo commented 6 years ago

Awesome; thanks for clarifying! I merged the changes. :sparkles:

ssssam commented 5 years ago

This change is triggering a segfault in Beets, see https://github.com/beetbox/audioread/issues/62