This function is problematic in several ways, its also quite unpredictable which flags it ends up turning on Signed-off-by: Michael Niedermayer <michaelni@gmx.at>