fftools/ffmpeg: use a mutex for enc_stats_write()

It may be called concurrently from different threads to write into the
same file.
This commit is contained in:
Anton Khirnov
2023-12-14 20:15:02 +01:00
parent 244d2fcc49
commit 2ad0b8e0ea
4 changed files with 16 additions and 0 deletions

View File

@@ -778,6 +778,10 @@ static void enc_stats_uninit(EncStats *es)
for (int i = 0; i < es->nb_components; i++)
av_freep(&es->components[i].str);
av_freep(&es->components);
if (es->lock_initialized)
pthread_mutex_destroy(&es->lock);
es->lock_initialized = 0;
}
static void ost_free(OutputStream **post)