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

Gwenole Beauchesne gbeauchesne at splitted-desktop.com
Thu Apr 2 10:46:02 CEST 2009


On Thu, 19 Feb 2009, Reimar Döffinger wrote:

> 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.

A patch is attached. I don't think this is a bug in FFmpeg, it's just that 
information is not available yet (slice headers are not parsed yet IIRC).

> The API may not explicitly require these to be set when get_format is
> called, but it does complicate things...

For AVCodecContext.get_format(), I'd believe this is expected behaviour to 
not strictly depend on a particular size.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mplayer.vd_ffmpeg.hwaccel.query_format.patch
Type: text/x-diff
Size: 1504 bytes
Desc: 
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20090402/e02f5f31/attachment.patch>


More information about the MPlayer-dev-eng mailing list