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