[FFmpeg-devel] [PATCH] BFI demuxer

Sisir Koppaka sisir.koppaka
Sat Apr 12 17:53:37 CEST 2008


On Sat, Apr 12, 2008 at 9:07 PM, Michael Niedermayer <michaelni at gmx.at>
wrote:

> On Sat, Apr 12, 2008 at 08:46:52PM +0530, Sisir Koppaka wrote:
> > Updated patch attached(Docs+build+demuxer).
> > I'm unable to checkout directly from the repo through http(only http is
> > allowed through our institute's proxy)...so I downloaded today's
> checkout
> > tar and diffed from that. The tar doesn't have a trunk so I made the
> patch
> > from /trunk/...I hope it won't be a problem.
>
> [...]
> > +        ret = av_get_packet(pb, pkt, audio_size);
> > +        if (ret < 0)
> > +            return ret;
> > +
> > +        pkt->stream_index = 1;
> > +        pkt->pts          = bfi->audio_frame;
> > +        bfi->audio_frame += ret;
> > +        bfi->avflag       = 1;
> > +    }
> > +
> > +    else {
> > +
> > +        //Tossing a video packet at the video decoder.
> > +        ret = av_get_packet(pb, pkt, bfi->video_size);
> > +        if (ret < 0)
> > +            return ret;
> > +
> > +        pkt->stream_index = 0;
> > +        pkt->pts          = bfi->video_frame;
> > +        bfi->video_frame += ret / bfi->video_size;
> > +        bfi->avflag       = 0;
> > +
> > +        /* One less frame to read. A cursory decrement. */
> > +        bfi->nframes--;
> > +    }
>
> some code can be factored out of the if/else

Is this ok?
    else {

        //Tossing a video packet at the video decoder.
        ret = av_get_packet(pb, pkt, bfi->video_size);
        if (ret < 0)
            return ret;

        pkt->pts          = bfi->video_frame;
        bfi->video_frame += ret / bfi->video_size;

        /* One less frame to read. A cursory decrement. */
        bfi->nframes--;
    }
    bfi->avflag = !(bfi->avflag);
    pkt->stream_index = bfi->avflag;
    return ret;
}


-----------------
Sisir Koppaka




More information about the ffmpeg-devel mailing list