[vlc-devel] [PATCH 2/2] avcodec: va: wait indefinitely until a surface is available

Rémi Denis-Courmont remi at remlab.net
Thu Jul 9 16:31:49 CEST 2020

Le jeudi 9 juillet 2020, 12:56:30 EEST Steve Lhomme a écrit :
> If there's no surface available the decoder should wait for one to be
> available, not get an error and not try to decode anymore. When pictures
> (and thus surfaces) were coming from the display a picture_pool_Wait() was
> used, so in the normal case we should do something similar.

In theory, yes. In practice, unfortunately, dubious.

> The infinite looping shouldn't be an issue as on Flush or Close the decoder
> will release all the past pictures/surfaces. So there will be new surfaces
> available for past calls.

It will still deadlock if one of the following is true:
- the loop is running on the main decoder thread, and thus will block flushing/
closing, or
- the picture pool is too small even for the "few" allocations after flush, in 
particular if there is shortage of memory on the GPU.

Not sure it's really safe yet.

Rémi Denis-Courmont

More information about the vlc-devel mailing list