avformat/hlsenc: reindent hlsenc code
authorSteven Liu <lq@chinaffmpeg.org>
Thu, 2 Nov 2017 14:30:06 +0000 (22:30 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Thu, 2 Nov 2017 14:30:06 +0000 (22:30 +0800)
Signed-off-by: Steven Liu <lq@onvideo.cn>
libavformat/hlsenc.c

index 6d573db..5ea9d21 100644 (file)
@@ -1444,36 +1444,36 @@ static int hls_write_header(AVFormatContext *s)
     }
 
     if (hls->segment_type == SEGMENT_TYPE_FMP4) {
-    if (av_strcasecmp(hls->fmp4_init_filename, "init.mp4")) {
-        hls->base_output_dirname = av_malloc(fmp4_init_filename_len);
-        if (!hls->base_output_dirname) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
-        av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len);
-    } else {
-        if (basename_size > 0) {
-            hls->base_output_dirname = av_malloc(basename_size);
+        if (av_strcasecmp(hls->fmp4_init_filename, "init.mp4")) {
+            hls->base_output_dirname = av_malloc(fmp4_init_filename_len);
+            if (!hls->base_output_dirname) {
+                ret = AVERROR(ENOMEM);
+                goto fail;
+            }
+            av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len);
         } else {
-            hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename));
-        }
-        if (!hls->base_output_dirname) {
-            ret = AVERROR(ENOMEM);
-            goto fail;
-        }
+            if (basename_size > 0) {
+                hls->base_output_dirname = av_malloc(basename_size);
+            } else {
+                hls->base_output_dirname = av_malloc(strlen(hls->fmp4_init_filename));
+            }
+            if (!hls->base_output_dirname) {
+                ret = AVERROR(ENOMEM);
+                goto fail;
+            }
 
-        if (basename_size > 0) {
-            av_strlcpy(hls->base_output_dirname, s->filename, basename_size);
-            p = strrchr(hls->base_output_dirname, '/');
-        }
-        if (p) {
-            *(p + 1) = '\0';
-            av_strlcat(hls->base_output_dirname, hls->fmp4_init_filename, basename_size);
-        } else {
-            av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len);
+            if (basename_size > 0) {
+                av_strlcpy(hls->base_output_dirname, s->filename, basename_size);
+                p = strrchr(hls->base_output_dirname, '/');
+            }
+            if (p) {
+                *(p + 1) = '\0';
+                av_strlcat(hls->base_output_dirname, hls->fmp4_init_filename, basename_size);
+            } else {
+                av_strlcpy(hls->base_output_dirname, hls->fmp4_init_filename, fmp4_init_filename_len);
+            }
         }
     }
-    }
 
     if (!hls->use_localtime) {
         ret = sls_flag_check_duration_size_index(hls);