Merge commit '803e82276b3716bf6012ec69e8854dae14a4fd2b'
[ffmpeg.git] / libavformat / smoothstreamingenc.c
index 0781a0a37081dfb99d86d246479ec5d4ebc1c7af..d2b7c9e92471bc2783ed27a874912b38325c1011 100644 (file)
@@ -292,7 +292,7 @@ static int ism_write_header(AVFormatContext *s)
     int ret = 0, i;
     AVOutputFormat *oformat;
 
-    if (mkdir(s->filename, 0777) < 0) {
+    if (mkdir(s->filename, 0777) == -1 && errno != EEXIST) {
         av_log(s, AV_LOG_ERROR, "mkdir failed\n");
         ret = AVERROR(errno);
         goto fail;
@@ -322,7 +322,7 @@ static int ism_write_header(AVFormatContext *s)
             goto fail;
         }
         snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%d)", s->filename, s->streams[i]->codec->bit_rate);
-        if (mkdir(os->dirname, 0777) < 0) {
+        if (mkdir(os->dirname, 0777) == -1 && errno != EEXIST) {
             ret = AVERROR(errno);
             av_log(s, AV_LOG_ERROR, "mkdir failed\n");
             goto fail;