]> git.sesse.net Git - ffmpeg/commitdiff
avformat/hlsenc: Remove redundant initializations
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 9 May 2020 13:59:43 +0000 (15:59 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 10 May 2020 19:40:41 +0000 (21:40 +0200)
For every variantstream vs, vs->packets_written is set to one, only to be
set to zero a few lines below. Given that the relevant structure has
been zeroed during the allocation, this commit removes both assignments.
A redundant initialization for vs->init_range_length has been removed as
well a few lines below. Given that the relevant structure has been
zeroed during the allocation, this commit removes both assignments. A
redundant initialization for vs->init_range_length has been removed as
well.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/hlsenc.c

index a796c124ddedf6f1516cd0f3a7397ee5947b8bcf..afb4d2a0c01b516e9f74dc256118c1146b80e2bd 100644 (file)
@@ -833,7 +833,6 @@ static int hls_mux_init(AVFormatContext *s, VariantStream *vs)
         av_dict_copy(&st->metadata, vs->streams[i]->metadata, 0);
     }
 
-    vs->packets_written = 1;
     vs->start_pos = 0;
     vs->new_start = 1;
 
@@ -848,9 +847,6 @@ static int hls_mux_init(AVFormatContext *s, VariantStream *vs)
         }
     }
 
-    vs->packets_written = 0;
-    vs->init_range_length = 0;
-
     if ((ret = avio_open_dyn_buf(&oc->pb)) < 0)
         return ret;