avformat/hdsenc: Read errno before av_log() as the callback from av_log() might affec...
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 25 Oct 2014 11:20:23 +0000 (13:20 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 25 Oct 2014 11:28:51 +0000 (13:28 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/hdsenc.c

index 98106f4..eec9bb8 100644 (file)
@@ -322,8 +322,8 @@ static int hds_write_header(AVFormatContext *s)
     AVOutputFormat *oformat;
 
     if (mkdir(s->filename, 0777) == -1 && errno != EEXIST) {
-        av_log(s, AV_LOG_ERROR , "Failed to create directory %s\n", s->filename);
         ret = AVERROR(errno);
+        av_log(s, AV_LOG_ERROR , "Failed to create directory %s\n", s->filename);
         goto fail;
     }