[MPlayer-dev-eng] [PATCH] Fix vd_ffmpeg.c::get_format() to actually query format

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Feb 19 14:10:04 CET 2009


On Thu, Feb 19, 2009 at 01:56:54PM +0100, Gwenole Beauchesne wrote:
> On Thu, 19 Feb 2009, Reimar Döffinger wrote:
>
>>> - Besides, there are cases where init_vo() (and more precisely,
>>> mpcodecs_config_vo()) is no-op because sh->disp_w and sh->disp_h are both 
>>> 0
>>> so we turned out to not actually test VO capabilities. IOW, get_format()
>>> can be called as early as neither width nor height are parsed yet.
>>
>> I am quite sure this is wrong. In order to test a pix_fmt you need to
>> completely destroy the filter chain and rebuilt it with conversion
>> filters inserted where-ever necessary, I can't see your query_format do
>> that?
>
> OK, a workaround, unless someone knows how to fix h264.c, is to make the 
> query_format() local to vd_ffmpeg.c and implement it as an init_vo() with 
> avctx->{width,height} set to some defaults if zero (e.g. 64x64), 
> temporarily. Then, once we know the actual size, VO is reconfigured anyway.

This seems fine to me (0x0 never makes sense, so something quite wrong
is still better than something totally wrong), but IMO it should be
reported as a bug/feature request against FFmpeg.
The API may not explicitly require these to be set when get_format is
called, but it does complicate things...



More information about the MPlayer-dev-eng mailing list