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