avcodec/pthread_slice: Don't reinitialise initialised mutex

It results in undefined behaviour. Instead initialize the mutexes
and condition variables once during init (and check these
initializations).

Also combine the corresponding mutex and condition variable
into one structure so that one can allocate their array
jointly.

Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2022-06-29 23:39:16 +02:00
parent 26e7d7b14e
commit 804bf898da
4 changed files with 63 additions and 33 deletions

View file

@ -958,6 +958,11 @@ int ff_thread_can_start_frame(AVCodecContext *avctx)
return 1;
}
int ff_slice_thread_init_progress(AVCodecContext *avctx)
{
return 0;
}
int ff_alloc_entries(AVCodecContext *avctx, int count)
{
return 0;