[FFmpeg-devel] [PATCH] Make parser not favor packets with pts/dts (and related fixes)

Michael Niedermayer michaelni
Wed Mar 4 22:22:13 CET 2009

On Wed, Mar 04, 2009 at 09:13:54PM +0100, Ivan Schreter wrote:
> Hi,
> Michael Niedermayer wrote:
>> patch below does make the parser treat packets equal, <put some joke 
>> mixing
>> human and packet rights here>
>> [...]
>> this should make it easier to feed pos in the parser as well
>> [...]
> Attached patches add support for storing packet position alongside dts/pts 
> in lavc and using it in lavf to determine correct frame position (provided 
> cur_pkt.pos is set correctly). They are prerequisite for seeking changes, 
> which rely on having AVPacket.pos set correctly.
> lavf patch causes regression in seek test (attached as well), since 
> positions are corrected. PTS/DTS is the same, so it seems perfectly OK.

> BTW, when committing changes, should the regression change go together in 
> one commit with the code which causes the regression, or separately?

regression changes should be in the comment that causes them to change so that
one can check out any revission and has a working "make test"

>                  got_packet:
>                      pkt->duration = 0;
>                      pkt->stream_index = st->index;
>                      pkt->pts = st->parser->pts;
>                      pkt->dts = st->parser->dts;
> +                    if (st->parser->pos != AV_NOPTS_VALUE)
> +                        pkt->pos = st->parser->pos;
> +                    else
> +                        pkt->pos = st->cur_pkt.pos;

is this still needed?
if so why?

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- 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/20090304/cd8b925b/attachment.pgp>

More information about the ffmpeg-devel mailing list