[vlc-devel] [PATCH] transcode: Fix multithreaded encoding

Rafaël Carré rafael.carre at gmail.com
Tue Nov 9 12:39:44 CET 2010


On Tue, 9 Nov 2010 10:55:27 +0100
"Steinar H. Gunderson" <sgunderson at bigfoot.com> wrote:

> On Mon, Nov 08, 2010 at 03:59:44PM +0100, Rafaël Carré wrote:
> >      id->p_encoder->i_threads = p_sys->i_threads;
> > +    /* We pass down the number of desired threads to the encoder
> > (avcodec/x264)
> > +     * But why would we want to run encoder asynchronously to the
> > decoder ?? */
> > +    p_sys->i_threads = 0;
> >      id->p_encoder->p_cfg = p_sys->p_video_cfg;
> 
> IIRC there's magic deep down here; the question is whether you'd want
> to run the _video_ encoder asynchronously to the _audio_ encoder, and
> due to some lock (perhaps on one of the FIFOs, I can't recall) this
> isn't possible with threads=0.

audio and video encoders are always run in parallel.

the threads option makes the video encoder and decoder synchronous or
not

(each line is a thread)

threads = 0
	audio decoder -> audio encoder
	video decoder -> video encoder (might spawn other threads)

threads = N > 0
	audio decoder -> audio encoder
	video decoder
	video encoder (spawns N-1 other threads)

-- 
✍ Rafaël Carré ☺
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20101109/865918c5/attachment.sig>


More information about the vlc-devel mailing list