[MPlayer-dev-eng] [PATCH] fix vo_png

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Feb 14 07:49:09 CET 2012


On 14 Feb 2012, at 01:20, Paul B Mahol <onemda at gmail.com> wrote:
> On 2/13/12, Ivan Kalvachev <ikalvachev at gmail.com> wrote:
>> After merging libav changes, ffmpeg no longer works with vo_png.
>> 
>> The problem is that avcodec_open2() function now wants a valid pix_fmt
>> to be set in avctx, but the current vo_png opens the encoder in
>> preinit() function, long before the exact pixel format
>> (RGB8/15/16/24/32) is known.
>> 
>> To fix this I've moved the avcodec_open2() function to
>> vo_png::config() and added a check for changed pixel format in case of
>> second call to config() without uninit() (this is valid behavior).
>> 
>> 
>> Please check the patch, I want to commit it soon.
>> 
> 
> Reopening codec when pix_fmt changes should not be needed.
> 
> Just adding fake but valid pix_fmt supported by png encoder should be
> enough before
> calling avcodec_open2().

That will work for now, but is not correct usage of the API and might fail later or even crash IMHO.
Patch looks ok to me btw., and simple enough.


More information about the MPlayer-dev-eng mailing list