[FFmpeg-devel] [PATCH] Make ffplay define in the encoder the number of threads *before* to open it

Stefano Sabatini stefano.sabatini-lala
Sun Mar 9 14:59:30 CET 2008


On date Saturday 2008-03-08 21:03:17 +0100, Michael Niedermayer encoded:
> On Sat, Mar 08, 2008 at 06:33:27PM +0100, Stefano Sabatini wrote:
> [...
> > Index: ffplay.c
> > ===================================================================
> > --- ffplay.c	(revision 12367)
> > +++ ffplay.c	(working copy)
> > @@ -1713,6 +1713,7 @@
> >      enc->skip_loop_filter= skip_loop_filter;
> >      enc->error_resilience= error_resilience;
> >      enc->error_concealment= error_concealment;
> > +    enc->thread_count= thread_count;
> >      if (!codec ||
> >          avcodec_open(enc, codec) < 0)
> >          return -1;
> > @@ -1735,7 +1736,6 @@
> >  
> >      if(thread_count>1)
> >          avcodec_thread_init(enc, thread_count);
> > -    enc->thread_count= thread_count;
> 
> wherver this line is moved the avcodec_thread_init should move as well
> Though maybe the "enc->thread_count= thread_count;" line can be removed
[...]

Fixed, it works with both threads enabled and disabled.

Without threads enabled enc->thread_count isn't set, so it defaults to the sane
value of 1.

Best regards.
-- 
Stefano Sabatini
Linux user number 337176 (see http://counter.li.org)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: make-ffplay-init-threads-num-before-opening-codec-01.patch
Type: text/x-diff
Size: 742 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080309/e1d6034d/attachment.patch>



More information about the ffmpeg-devel mailing list