Extract some setup code into a separate function.

This allows reusing it to restore the correct settings
if setting up hardware acceleration failed.
Note: as an optimization we should not attempt to use
the hwaccel pixfmts if the codecs.conf entry disallows
them.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36422 b3059339-0415-0410-9bf9-f77b7e298cf2