[FFmpeg-devel] [PATCH] make mpeg4 parser set has_b_frames

Michael Niedermayer michaelni
Thu Nov 22 02:41:29 CET 2007


On Thu, Nov 22, 2007 at 02:09:11AM +0100, elupus wrote:
> > On Thu, Nov 22, 2007 at 12:45:01AM +0100, elupus wrote:
> > >
> > > On a different but related note, should pts really be set to dts in
> > > compute_pkt_fields if pts is missing? wouldn't it be better to leave 
> > > that
> > > up to the player? or atleast be conditional on GENPTS flag.
> >
> > what you say makes no sense, because the code doesnt do what you claim
> > it does, please RTFS!
> 
> compute_pkt_fields is called on each packet nomatter of genpts or not..

of course, compute_pkt_fields() is the fast "just fill in what we can with no
knowledge of the future" code
genpts is the "find the pts even if we have to read ahead the whole file" code


> ....
> delay= st->codec->has_b_frames; // == 0
> presentation_delayed = 0;
> ....
> if(delay <=1)
>     if(presentation_delayed)
>     ...
>     else if(pkt->pts != AV_NOPTS_VALUE || pkt->dts != AV_NOPTS_VALUE
>            || pkt->duration)  {
>             .....
>             if(pkt->pts == AV_NOPTS_VALUE)
>                 pkt->pts = pkt->dts;
>      }
> 
> But I assume you won't be bothered to look so the above was probably a waste 
> of typing.

if has_b_frames==0 there are no b frames, so dts==pts
you cant expect code to provide you with correct output if you feed
it with incorrect input

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

Thouse who are best at talking, realize last or never when they are wrong.
-------------- 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/20071122/a62e3dab/attachment.pgp>



More information about the ffmpeg-devel mailing list