Skip to content

Commit

Permalink
avformat/movenc, segafilmenc: Remove unnecessary avio_tell()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
mkver authored and michaelni committed Jan 17, 2020
1 parent c95dfe5 commit 61e0d71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libavformat/movenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
2 changes: 1 addition & 1 deletion libavformat/segafilmenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 61e0d71

Please sign in to comment.