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