[FFmpeg-devel] [PATCH] ogg: Fix seek to zero and packet pts after read through.

Dale Curtis dalecurtis at chromium.org
Tue Apr 24 22:37:14 CEST 2012


On Mon, Apr 23, 2012 at 7:13 PM, Michael Niedermayer <michaelni at gmx.at>wrote:
>
>  > > +            stream->lastpts = 0;
> > > +            stream->lastdts = 0;
>
> this doesnt look entirely right
> for codecs with b frames  pts is != dts  for some frames
>

It seems only necessary to set lastpts = 0, so I can set lastdts =
AV_NOPTS_VALUE instead if that's preferred. The pts/dts come back correctly
on all the files I've tested with. If you have a file which this breaks,
please let me know and I'm happy to investigate.


> as you mention this was tested since a while
> have you checked that pts at the start is always 0 as the patch seems
> to assume
>

pts at the start is not always zero, however we're not setting pts/dts,
only the lastpts/lastdts. The correct information will be filled in by the
next read. The first pts in the included test case is non-zero; with the
patch applied the first pts comes back correctly:

1st pass pts: -128   0 128 256  832
2nd pass pts: -128   0 128 256  832

- dale


More information about the ffmpeg-devel mailing list