mirror of https://github.com/mpv-player/mpv
9a861c930b
The screenshot command is documented to not overwrite existing files. However, there is a race window between the filename is generated with gen_fname and when the file is open to write. Specifically, the convert_image function in this window can be very time consuming depending on video and screenshot image format and size. This results in existing file being overwritten because the file writing functions don't check for the existance of file. Fix this be opening the file in exclusive mode. Add overwrite parameter to write_image for other operations that are documented to overwrite existing files, like screenshot-to-file. Note that for write_avif, checking existance is used instead because avio_open does not support exclusive open mode. |
||
---|---|---|
.. | ||
ref | ||
chmap.c | ||
gl_video.c | ||
img_format.c | ||
img_utils.c | ||
img_utils.h | ||
json.c | ||
libmpv_test.c | ||
linked_list.c | ||
meson.build | ||
paths.c | ||
repack.c | ||
scale_sws.c | ||
scale_test.c | ||
scale_test.h | ||
scale_zimg.c | ||
test_utils.c | ||
test_utils.h | ||
timer.c |