diff mbox series

[FFmpeg-devel,1/2] avformat/movenc, segafilmenc: Remove unnecessary avio_tell()

Message ID 20200116044915.13681-1-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/2] avformat/movenc, segafilmenc: Remove unnecessary avio_tell() | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt Jan. 16, 2020, 4:49 a.m. UTC
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>
---
 libavformat/movenc.c      | 2 +-
 libavformat/segafilmenc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Michael Niedermayer Jan. 17, 2020, 8:19 p.m. UTC | #1
On Thu, Jan 16, 2020 at 05:49:14AM +0100, Andreas Rheinhardt wrote:
> 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>
> ---
>  libavformat/movenc.c      | 2 +-
>  libavformat/segafilmenc.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

will apply patchset

thx

[...]
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index a2cfc59b89..282d14ab1a 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6718,7 +6718,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];
diff --git a/libavformat/segafilmenc.c b/libavformat/segafilmenc.c
index 6b66c68328..93c482ef7d 100644
--- a/libavformat/segafilmenc.c
+++ b/libavformat/segafilmenc.c
@@ -209,7 +209,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];