]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: simplified code of use_localtime in hls_init
authorSteven Liu <lq@chinaffmpeg.org>
Tue, 20 Aug 2019 02:31:01 +0000 (10:31 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Wed, 21 Aug 2019 08:46:31 +0000 (16:46 +0800)
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index c740cf2c563b1316f03e181fff4b3c57b15486af..9511b65e2d6b3347cb09d391db3ddcd82861991b 100644 (file)
@@ -2875,17 +2875,10 @@ static int hls_init(AVFormatContext *s)
             }
         }
 
-        if (!hls->use_localtime) {
-            ret = sls_flag_check_duration_size_index(hls);
-            if (ret < 0) {
-                goto fail;
-            }
-        } else {
-            ret = sls_flag_check_duration_size(hls, vs);
-            if (ret < 0) {
-                goto fail;
-            }
-        }
+        ret = hls->use_localtime ? sls_flag_check_duration_size(hls, vs) : sls_flag_check_duration_size_index(hls);
+        if (ret < 0)
+            goto fail;
+
         if (vs->has_subtitle) {
 
             if (hls->flags & HLS_SINGLE_FILE)