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