mirror of https://git.ffmpeg.org/ffmpeg.git
ffmpeg_opt: assert_file_overwrite: Work for all file protocol outputs
Currently the file overwrite check does not work for paths that contain a colon. Use avio_find_protocol to always execute the existence check if the file protocol is going to be used. Fix remaining part of ticket #3249. Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
This commit is contained in:
parent
db3c9701f4
commit
2b17c7685f
|
@ -697,10 +697,9 @@ static void assert_file_overwrite(const char *filename)
|
||||||
exit_program(1);
|
exit_program(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!file_overwrite &&
|
if (!file_overwrite) {
|
||||||
(strchr(filename, ':') == NULL || filename[1] == ':' ||
|
const char *proto_name = avio_find_protocol_name(filename);
|
||||||
av_strstart(filename, "file:", NULL))) {
|
if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) {
|
||||||
if (avio_check(filename, 0) == 0) {
|
|
||||||
if (stdin_interaction && !no_file_overwrite) {
|
if (stdin_interaction && !no_file_overwrite) {
|
||||||
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
|
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
|
Loading…
Reference in New Issue