[FFmpeg-devel] [PATCH] rmdec.c: merge old/new packet reading code

Kostya kostya.shishkov
Tue Mar 10 15:22:45 CET 2009


On Tue, Mar 10, 2009 at 08:47:31AM -0400, Ronald S. Bultje wrote:
> Hi Kostya,
> 
> On Tue, Mar 10, 2009 at 2:26 AM, Kostya <kostya.shishkov at gmail.com> wrote:
> >> ? ? ? ? ?if (ff_rm_parse_packet (s, s->pb, st, st->priv_data, len, pkt,
> >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?&seq, &flags, &timestamp) < 0)
> >> ? ? ? ? ? ? ?goto resync;
> >> + ? ?}
> >
> > } while(ff_rm_parse_packet (...) < 0);
> >
> > I like goto's but this one is rather unneeded (and is not that qualified to
> > be called resync now).
> >
> >> ? ? ? ? ?if( ?(st->discard >= AVDISCARD_NONKEY && !(flags&2))
> >> ? ? ? ? ? ? || st->discard >= AVDISCARD_ALL){
> >
> > And you can move discarding logic into the loop without need for emptying
> > cache inside it.
> 
> These two don't go together, not literally at least. I guess a for(;;)
> loop is OK also. Let me know if the attached is what you had in mind
> (minus the do{}while();).
> 
> Ronald

Looks ok. And yes, it looks like what I want :)




More information about the ffmpeg-devel mailing list