summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-04-09 01:32:37 +0200
committerAnton Khirnov <anton@khirnov.net>2011-04-19 19:48:07 +0200
commit55815edca038997ec283569a192a3eca7f2143bc (patch)
tree6c3910611d7f68cd049c4b66a57c525d0de86aee /ffmpeg.c
parent59d96941f0285a501989d5f2c9b69be0a1393ed5 (diff)
prefer avio_check() over url_exist()
The problem with url_exist() is that it tries to open a resource in RDONLY mode. If the file is a FIFO and there is already a reading client, the open() call will hang. By using avio_check() with access mode of 0, the second reading process will check if the file exists without attempting to open it, thus avoiding the lock. Fix issue #1663. Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 5b6e3eae67..6e620bf55e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3733,7 +3733,7 @@ static void opt_output_file(const char *filename)
(strchr(filename, ':') == NULL ||
filename[1] == ':' ||
av_strstart(filename, "file:", NULL))) {
- if (url_exist(filename)) {
+ if (avio_check(filename, 0) == 0) {
if (!using_stdin) {
fprintf(stderr,"File '%s' already exists. Overwrite ? [y/N] ", filename);
fflush(stderr);