Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit b4483a531a139f304f4370f470325facb107202f)
This needs work but it should not rot in soc svn.