[Ffmpeg-devel] Re: Broken decoding of mpeg2?

Rich Felker dalias
Tue Mar 21 17:46:12 CET 2006


On Tue, Mar 21, 2006 at 12:21:55PM +0100, Joakim Plate wrote:
> 
> ">> You are probably using some sort of direct rendering, it doesn't work 
> with
> >> some outputs in mplayer for example. mplayer reporting that lavc supports
> >> aritrairy strides even thou mpeg12 decoder doesn't even support any 
> >> change
> >> in it.
> >
> > arbitrary != change
> > to make a silly analogy, a car might support arbitrary tires but changing
> > them while driving still would be tricky
> >
> > the buffers for direct rendering are the internal buffers used by ffmpeg
> > theese have strict restrictions on alignment and unchanging stride, if
> > the user app cant provide this then direct rendering should not be used
> >
> > [...]
> > -- 
> > Michael
> 
> Agreed, but my point is this.. mplayer overrides the default get_buffer 
> function with it's own.
> 
> static int get_buffer(AVCodecContext *avctx, AVFrame *pic){
>     sh_video_t * sh = avctx->opaque;
>     vd_ffmpeg_ctx *ctx = sh->context;
>     mp_image_t* mpi=NULL;
>     int flags= MP_IMGFLAG_ACCEPT_STRIDE | MP_IMGFLAG_PREFER_ALIGNED_STRIDE;
>     int type= MP_IMGTYPE_IPB;
>     int width= avctx->width;
>     int height= avctx->height;
>     int align=15;
> ...
> ...
> 
> the flag MP_IMGFLAG_ACCEPT_STRIDE is passed to the next filter or output, 
> wich in for example the directx renderer means it can return an arbitrary 
> stride and alignment (depends on pitch of the d3d texture it allocates). A 

Yes, this is a problem. As far as I know, MPlayer's (very bad) video
filter layer does not provide any way to specify that you require a
specific stride. Without MP_IMGFLAG_ACCEPT_STRIDE the requirement is
that stride == width, IIRC.. :(

Rich





More information about the ffmpeg-devel mailing list