[FFmpeg-devel] [PATCH] Reset pts_correction on codec flush

Michael Niedermayer michaelni at gmx.at
Wed Apr 18 14:40:40 CEST 2012


On Wed, Apr 18, 2012 at 02:36:16PM +0200, Robert Nagy wrote:
> Not sure if this is the right place to add this code, however the
> pts_correction state should probably be reset on codec flush?

>  utils.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 023f8a9f10a999015b083b646dc5f42ba5e74c3b  0001-Reset-pts_correction-state-on-codec-flush.patch
> From 941edc57f7ade290d80cfe973a3dbb8a662b1f77 Mon Sep 17 00:00:00 2001
> From: Robert Nagy <ronag89 at gmail.com>
> Date: Wed, 18 Apr 2012 14:32:27 +0200
> Subject: [PATCH] Reset pts_correction state on codec flush.
> 
> ---
>  libavcodec/utils.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index f6c9466..993b06d 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1879,6 +1879,11 @@ void avcodec_flush_buffers(AVCodecContext *avctx)
>          ff_thread_flush(avctx);
>      else if(avctx->codec->flush)
>          avctx->codec->flush(avctx);
> +		

tabs


> +    avctx->pts_correction_num_faulty_pts =
> +    avctx->pts_correction_num_faulty_dts = 0;

iam not sure about these, i think it might be better not to throw the
accumulated statistcis away


> +    avctx->pts_correction_last_pts =
> +    avctx->pts_correction_last_dts = INT64_MIN;

ok

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120418/d5a194c5/attachment.asc>


More information about the ffmpeg-devel mailing list