vo png: Switch to avcodec_encode_video2

The older function is deprecated and the newer function seems to not
have the minimum buffer size limitation.

Patch by Jiang Jiang >gzjjgod at gmail com<



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@36423 b3059339-0415-0410-9bf9-f77b7e298cf2
vo png: Error handling and clean up

Simplify error path; returning 1 is obfuscated and not different
from returning VO_TRUE. We do not want to fatally error out anyway,
so printing a warning should be enough and not different from the
current behaviour.

Use av_free_packet, it is the counter part for av_init_packet .
It could e.g. potentially free side data. The buffer itself
will not be freed as is intended for our custom buffer which
we will try to re-use.



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