]> git.sesse.net Git - ffmpeg/commitdiff
avformat/movenc, segafilmenc: Remove unnecessary avio_tell()
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 16 Jan 2020 04:49:14 +0000 (05:49 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 17 Jan 2020 19:17:55 +0000 (20:17 +0100)
When the faststart option for the mov/mp4 muxer is used, the current
position (i.e. the size of the already written data pre-shifting) was
evaluated twice: First in an initialization and then again later,
overwriting the first value without having ever touched it. So remove
the initialization.

Also, the clone of this code in the Sega FILM muxer behaves the same and
has been treated the same.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/movenc.c
libavformat/segafilmenc.c

index 9111ac300c089d4fb749c2ac38a58021325e2cbf..fb44ee2c712d6f24d4b1d83f485b265ef6be9eb2 100644 (file)
@@ -6720,7 +6720,7 @@ static int shift_data(AVFormatContext *s)
 {
     int ret = 0, moov_size;
     MOVMuxContext *mov = s->priv_data;
-    int64_t pos, pos_end = avio_tell(s->pb);
+    int64_t pos, pos_end;
     uint8_t *buf, *read_buf[2];
     int read_buf_id = 0;
     int read_size[2];
index bd7c03faf5d77038e6a982961838f1ca9ee28c84..28cb7bfc85a3c9372ff43a79cb188f4143789e10 100644 (file)
@@ -212,7 +212,7 @@ static int film_init(AVFormatContext *format_context)
 static int shift_data(AVFormatContext *format_context, int64_t shift_size)
 {
     int ret = 0;
-    int64_t pos, pos_end = avio_tell(format_context->pb);
+    int64_t pos, pos_end;
     uint8_t *buf, *read_buf[2];
     int read_buf_id = 0;
     int read_size[2];