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:
@@ -402,6 +402,11 @@ fail:
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = pthread_mutex_init(&es->lock, NULL);
|
||||
if (ret)
|
||||
return AVERROR(ret);
|
||||
es->lock_initialized = 1;
|
||||
|
||||
ret = enc_stats_get_file(&es->io, path);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user