Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Strasser <eclipse7@gmx.net>2014-01-05 06:06:20 +0400
committerAlexander Strasser <eclipse7@gmx.net>2014-02-17 01:34:21 +0400
commit2b17c7685fd3ff0bffaf3b45458d4a6283f3935f (patch)
tree58a0b808abe5a9b9b8422543862b5d6acbdb7f38 /ffmpeg_opt.c
parentdb3c9701f46d20fd7e94c3222cf4fd4524a16414 (diff)
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>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r--ffmpeg_opt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 4e0dc478e6..26798f712b 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -697,10 +697,9 @@ static void assert_file_overwrite(const char *filename)
exit_program(1);
}
- if (!file_overwrite &&
- (strchr(filename, ':') == NULL || filename[1] == ':' ||
- av_strstart(filename, "file:", NULL))) {
- if (avio_check(filename, 0) == 0) {
+ if (!file_overwrite) {
+ const char *proto_name = avio_find_protocol_name(filename);
+ if (proto_name && !strcmp(proto_name, "file") && avio_check(filename, 0) == 0) {
if (stdin_interaction && !no_file_overwrite) {
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
fflush(stderr);