ffmpeg: Backport c94305ae23318c8956a30485cd5642829f4f16a9 to fix #15085