summaryrefslogtreecommitdiff
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-05-29 17:14:18 +0200
committerMarton Balint <cus@passwd.hu>2016-05-31 00:35:16 +0200
commit0d0b9397d63aeedb55f624ee2b976c0d391c494e (patch)
tree7ef3b3a0a988e9069593ef08410b9d9b79f27e6b /libavformat/movenc.c
parent15005701b590dfeed3d597444f1f5391ff1cfbb0 (diff)
avformat/movenc: remove useless if and reindent
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f8bfcfe7cd..cb3a70a842 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -5733,11 +5733,9 @@ static int mov_write_trailer(AVFormatContext *s)
res = shift_data(s);
if (res < 0)
goto error;
- if (res == 0) {
- avio_seek(pb, mov->reserved_header_pos, SEEK_SET);
- if ((res = mov_write_moov_tag(pb, mov, s)) < 0)
- goto error;
- }
+ avio_seek(pb, mov->reserved_header_pos, SEEK_SET);
+ if ((res = mov_write_moov_tag(pb, mov, s)) < 0)
+ goto error;
} else if (mov->reserved_moov_size > 0) {
int64_t size;
if ((res = mov_write_moov_tag(pb, mov, s)) < 0)
@@ -5762,17 +5760,16 @@ static int mov_write_trailer(AVFormatContext *s)
for (i = 0; i < mov->nb_streams; i++)
mov->tracks[i].data_offset = 0;
if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX) {
+ int64_t end;
av_log(s, AV_LOG_INFO, "Starting second pass: inserting sidx atoms\n");
res = shift_data(s);
if (res < 0)
goto error;
- if (res == 0) {
- int64_t end = avio_tell(pb);
- avio_seek(pb, mov->reserved_header_pos, SEEK_SET);
- mov_write_sidx_tags(pb, mov, -1, 0);
- avio_seek(pb, end, SEEK_SET);
- mov_write_mfra_tag(pb, mov);
- }
+ end = avio_tell(pb);
+ avio_seek(pb, mov->reserved_header_pos, SEEK_SET);
+ mov_write_sidx_tags(pb, mov, -1, 0);
+ avio_seek(pb, end, SEEK_SET);
+ mov_write_mfra_tag(pb, mov);
} else {
mov_write_mfra_tag(pb, mov);
}