[FFmpeg-cvslog] avformat/webm_chunk: Remove unnecessary variable

Andreas Rheinhardt git at videolan.org
Thu Mar 26 03:24:57 EET 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sun Mar  1 00:23:38 2020 +0100| [73a595b8e8366e1cc01d318db31d5c800a32bef8] | committer: Andreas Rheinhardt

avformat/webm_chunk: Remove unnecessary variable

chunk_start_index (which was set via an option) was only used to
initialize chunk_index and otherwise unused. So initialize chunk_index
directly via the option and remove chunk_start_index.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=73a595b8e8366e1cc01d318db31d5c800a32bef8
---

 libavformat/webm_chunk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
index 7b1f1a8b48..af0d6b9d76 100644
--- a/libavformat/webm_chunk.c
+++ b/libavformat/webm_chunk.c
@@ -46,7 +46,6 @@
 
 typedef struct WebMChunkContext {
     const AVClass *class;
-    int chunk_start_index;
     char *header_filename;
     int chunk_duration;
     int chunk_index;
@@ -152,7 +151,6 @@ static int webm_chunk_write_header(AVFormatContext *s)
     // DASH Streams can only have either one track per file.
     if (s->nb_streams != 1) { return AVERROR_INVALIDDATA; }
 
-    wc->chunk_index = wc->chunk_start_index;
     wc->prev_pts = AV_NOPTS_VALUE;
 
     ret = chunk_mux_init(s);
@@ -274,7 +272,7 @@ fail:
 
 #define OFFSET(x) offsetof(WebMChunkContext, x)
 static const AVOption options[] = {
-    { "chunk_start_index",  "start index of the chunk", OFFSET(chunk_start_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
+    { "chunk_start_index",  "start index of the chunk", OFFSET(chunk_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
     { "header", "filename of the header where the initialization data will be written", OFFSET(header_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
     { "audio_chunk_duration", "duration of each chunk in milliseconds", OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 5000}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
     { "method", "set the HTTP method", OFFSET(http_method), AV_OPT_TYPE_STRING, {.str = NULL},  0, 0, AV_OPT_FLAG_ENCODING_PARAM },



More information about the ffmpeg-cvslog mailing list