[FFmpeg-devel] [PATCH] ffplay: Update input_get_buffer() to match avcodec_default_get_buffer()

Michael Niedermayer michaelni at gmx.at
Thu Oct 6 13:14:17 CEST 2011

On Thu, Oct 06, 2011 at 11:13:48AM +0200, Nicolas George wrote:
> Le quintidi 15 vendémiaire, an CCXX, Michael Niedermayer a écrit :
> > Subject: [PATCH] ffplay: Update input_get_buffer() to match avcodec_default_get_buffer()
> Shouldn't the same change be made to reget_buffer? It is not done in
> lavc/utils.c, but it seems wrong.
> Maybe a common function would be a good thing:
> 	avcodec_init_buffer_info(avctx, pix)
> ?

I think even better would be below + updating all decoders
the advanatge would be that applications would not need to be chnaged
nor have to deal with extra complexity and yet another function

static int avcodec_get_buffer(AVCodecContext *s, AVFrame *pic, int reget, int reference){
    int ret;

    pic->reference= reference;

        ret= s->reget_buffer(s, pic);
        ret= s->get_buffer(s, pic);

        return ret;

    if (s->pkt) {
        pic->pkt_pts = s->pkt->pts;
        pic->pkt_pos = s->pkt->pos;
    } else {
        pic->pkt_pts = AV_NOPTS_VALUE;
        pic->pkt_pos = -1;
    pic->reordered_opaque= s->reordered_opaque;
    pic->sample_aspect_ratio = s->sample_aspect_ratio;
    pic->width               = s->width;
    pic->height              = s->height;
    pic->format              = s->pix_fmt;

    return ret;

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20111006/1ad1619a/attachment.asc>

More information about the ffmpeg-devel mailing list