Bssed on patch by Øyvind Kolås <pippin@gimp.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>