[vlc-devel] [PATCH] Avcodec: limit the number of threads automatically selected to 12

Laurent Aimar fenrir at elivagar.org
Thu Dec 29 16:24:44 CET 2011

On Thu, Dec 29, 2011 at 09:31:07AM +0100, Denis Charmet wrote:
> Le mercredi 28 décembre 2011 à 11:59:49, Rafaël Carré a écrit :
> > Le 2011-12-28 21:08, Jean-Baptiste Kempf a écrit :
> > > It seems that over 16 doesn't behave well. Reduce it further for safety
> > 
> > What is the problem exactly ?
> > 
> IMO, as I said earlier I strongly suspect a race condition in picture
> pool with two threads working on the same picture. Would'nt it be
> cleaner and safer to just lock/unlock around decoder_NewPicture in
> avcodec/video.c ?
 A decoder goes through vout_GetPicture() which already protects the
pool used with a lock.
 I think the issue is that the pool might be too small when there is
too much thread as the latency increase.
 For a quick test, could you test by increasing the value dpb_size
in src/input/decoder.c by the number of threads (in the function
vout_new_buffer()). If it fixes the issue, decoder_t will have to be
extended to allow transmitting the value.



More information about the vlc-devel mailing list