Workaround crashing behavior in libavdevice.