summaryrefslogtreecommitdiff
path: root/libavformat/hdsenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/hdsenc.c')
-rw-r--r--libavformat/hdsenc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/hdsenc.c b/libavformat/hdsenc.c
index 6217c1f51f..882f157d91 100644
--- a/libavformat/hdsenc.c
+++ b/libavformat/hdsenc.c
@@ -323,7 +323,10 @@ static int hds_write_header(AVFormatContext *s)
int ret = 0, i;
AVOutputFormat *oformat;
- mkdir(s->filename, 0777);
+ if (mkdir(s->filename, 0777) == -1 && errno != EEXIST) {
+ ret = AVERROR(errno);
+ goto fail;
+ }
oformat = av_guess_format("flv", NULL, NULL);
if (!oformat) {