[FFmpeg-devel] [PATCH 4/5] Prefer pts over dts in timestamp correction

Michael Niedermayer michaelni
Tue Jul 27 15:10:36 CEST 2010


On Mon, Jul 26, 2010 at 01:16:09PM -0700, Alexander Strange wrote:
> Fixes decoder delay incorrectly causing the output picture timestamps
> to change.
> ---
>  cmdutils.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/cmdutils.c b/cmdutils.c
> index cd0b194..f86a182 100644
> --- a/cmdutils.c
> +++ b/cmdutils.c
> @@ -682,7 +682,7 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, int64_t reordered_pts, int6
>          ctx->num_faulty_pts += reordered_pts <= ctx->last_pts;
>          ctx->last_pts = reordered_pts;
>      }
> -    if ((ctx->num_faulty_pts<ctx->num_faulty_dts || dts == AV_NOPTS_VALUE)
> +    if ((ctx->num_faulty_pts<=ctx->num_faulty_dts || dts == AV_NOPTS_VALUE)
>         && reordered_pts != AV_NOPTS_VALUE)
>          pts = reordered_pts;
>      else

This looks like your code doesnt work with dts.
A file can require the use of dts by not having pts or having incorrect
pts, this code is there to select which of dts/pts is better.
Biasing slightly to pts isnt going to help if there are no pts or wrong
pts.


[...]
-- 
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: 190 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100727/f99f8700/attachment.pgp>



More information about the ffmpeg-devel mailing list