[FFmpeg-devel] [PATCH] BFI demuxer

Michael Niedermayer michaelni
Sat Apr 12 18:14:46 CEST 2008


On Sat, Apr 12, 2008 at 09:23:37PM +0530, Sisir Koppaka wrote:
> 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);

superflous ()


>     pkt->stream_index = bfi->avflag;
>     return ret;


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080412/9faadb14/attachment.pgp>



More information about the ffmpeg-devel mailing list