[FFmpeg-devel] [PATCH] pthreads: export the delay that was previously exported by mangling has_b_frames through AVCodecContext.delay

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Nov 9 20:05:26 CET 2011


On Wed, Nov 09, 2011 at 07:06:08PM +0100, Michael Niedermayer wrote:
> Hi
> 
> patch below maybe usefull to applications which want to know the
> thread count used in frame multitherading.
> mplayer & mplayer2 fall in this category possibly.

I don't think mplayer2 is (generally) affected actually.

> From bd352d408af3928d9c53f4cea6a44a0797542cf1 Mon Sep 17 00:00:00 2001
> From: Michael Niedermayer <michaelni at gmx.at>
> Date: Wed, 9 Nov 2011 18:32:38 +0100
> Subject: [PATCH] pthreads: export the delay that was previously exported by mangling has_b_frames through
>  AVCodecContext.delay which was previously unused for decoders and fits better.
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/pthread.c |    1 +
>  libavcodec/version.h |    2 +-
>  2 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
> index 4a44cea..04181e2 100644
> --- a/libavcodec/pthread.c
> +++ b/libavcodec/pthread.c
> @@ -363,6 +363,7 @@ static int update_context_from_thread(AVCodecContext *dst, AVCodecContext *src,
>      }
>  
>      if (for_user) {
> +        dst->delay         = src->thread_count - 1;

Well, if set like this it should probably include a change to the
description that for decode it is the delay added due to decoding
_beyond_ the reorder delay.


More information about the ffmpeg-devel mailing list