gstavviddec: Limit default number of decoder threads
authorAlicia Boya García <ntrrgc@gmail.com>
Thu, 19 Dec 2019 16:58:56 +0000 (17:58 +0100)
committerAlicia Boya García <ntrrgc@gmail.com>
Thu, 19 Dec 2019 21:59:44 +0000 (21:59 +0000)
commitb7d450b11834d0a510fdcb661ce105860338e2d6
tree58d38289c6c884bc2c0f50933602a2cf0ef5aad3
parent77f63c2457952ce6883002afe0dc9abe82b5e4e7
gstavviddec: Limit default number of decoder threads

When the `max-threads` property is not specified, GStreamer defaults to
the amount of CPU threads in the system.

The number of threads used in avdec has a direct impact on the latency
of the decoder, which is of as many frames as threads. Therefore, big
numbers of threads can make latency levels that can be problematic in
some applications.

For this reason, ffmpeg emits a warning when more than 16 threads are
requested.

This patch limits the default number of threads to 16. This affects only
computers with more than 16 CPU threads when using avviddec without
setting `max-threads`.
ext/libav/gstavviddec.c