cherry picked from commit 903236292f066bc321080e3e2192b64f8943d960 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>