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