History

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.

Alexander Strasser committed 12 years ago

Commit 2b17c761 parent db3c9701 file · +3 −4Browse files

Unified · Split

ffmpeg_opt.c+3−4
@@ -697,10 +697,9 @@ static void assert_file_overwrite(const char *filename) · 696 unmodified lines
697 exit_program(1);697 exit_program(1);
698 }698 }
699 699
700 if (!file_overwrite &&700 if (!file_overwrite) {
701 (strchr(filename, ':') == NULL || filename[1] == ':' ||701 const char *proto_name = avio_find_protocol_name(filename);
702 av_strstart(filename, "file:", NULL))) {702 if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) {
703 if (avio_check(filename, 0) == 0) {
704 if (stdin_interaction && !no_file_overwrite) {703 if (stdin_interaction && !no_file_overwrite) {
705 fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);704 fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
706 fflush(stderr);705 fflush(stderr);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t