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

Michael Niedermayer michaelni at gmx.at
Wed Nov 9 20:09:14 CET 2011


On Wed, Nov 09, 2011 at 08:05:26PM +0100, Reimar Döffinger wrote:
> 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.

I can set it to anything that people prefer but this way
delay + has_b_frames would give the old value for both ffmpeg and
libav.

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

It is what and why we do it that matters, not just one of them.
-------------- 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/20111109/379182da/attachment.asc>


More information about the ffmpeg-devel mailing list