Ensure dimensions are set before opening libavcodec encoder.

This is a requirement that was added some time ago, we
so far relied on a hack in libavcodec, but that isn't
really a good idea.
Only lightly tested.

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