screenshot: fix libav API use (pix_fmt and some other things)
commite796c7495cab78e0468c9c3a76b1bcaa3fcd1798
authorwm4 <wm4@mplayer2.org>
Thu, 16 Feb 2012 16:30:22 +0000 (16 17:30 +0100)
committerUoti Urpala <uau@mplayer2.org>
Sat, 25 Feb 2012 14:29:52 +0000 (25 16:29 +0200)
tree34b6939a7bc47350de22ed59f9803e39305afbbe
parentda52c9400defebc3f5840acc1f9eb0ead1a759cb
screenshot: fix libav API use (pix_fmt and some other things)

Libavcodec started checking that avctx->pix_fmt is set when opening
an encoder. The existing code (originally from vf_screenshot.c) only
set it afterwards, which now made screenshots fail. Fix the code to
set parameters before calling avcodec_open2().

Also fix some minor things, which seems to make it work for other
encoders. This could be used to add more libavcodec based image
writers. Fix memory leak (missing av_free(avctx)).
screenshot.c