avformat: remove unneeded avio_flush() calls from the end of write_trailer functions

The IO context is always flushed by libavformat/mux.c after write_trailer is
called, so this change should have no effect at all.
This commit is contained in:
Marton Balint 2020-01-04 19:31:14 +01:00
parent 4bf90e095b
commit c05d82fa92
13 changed files with 0 additions and 18 deletions

View File

@ -263,8 +263,6 @@ static int aiff_write_trailer(AVFormatContext *s)
file_size = avio_tell(pb);
avio_seek(pb, aiff->form, SEEK_SET);
avio_wb32(pb, file_size - aiff->form - 4);
avio_flush(pb);
}
return ret;

View File

@ -178,7 +178,6 @@ static int ast_write_trailer(AVFormatContext *s)
}
avio_seek(pb, file_size, SEEK_SET);
avio_flush(pb);
}
return 0;
}

View File

@ -326,7 +326,6 @@ static int au_write_trailer(AVFormatContext *s)
avio_seek(pb, 8, SEEK_SET);
avio_wb32(pb, (uint32_t)(file_size - au->header_size));
avio_seek(pb, file_size, SEEK_SET);
avio_flush(pb);
}
return 0;

View File

@ -258,7 +258,6 @@ static int caf_write_trailer(AVFormatContext *s)
avio_write(pb, caf->pkt_sizes, caf->size_entries_used);
caf->size_buffer_size = 0;
}
avio_flush(pb);
}
av_freep(&caf->pkt_sizes);
return 0;

View File

@ -349,7 +349,6 @@ static int flac_write_trailer(struct AVFormatContext *s)
avio_seek(pb, 8, SEEK_SET);
avio_write(pb, streaminfo, FLAC_STREAMINFO_SIZE);
avio_seek(pb, file_size, SEEK_SET);
avio_flush(pb);
} else {
av_log(s, AV_LOG_WARNING, "unable to rewrite FLAC header.\n");
}

View File

@ -152,7 +152,6 @@ static int hash_write_trailer(struct AVFormatContext *s)
av_hash_final_hex(c->hashes[i], buf + strlen(buf), sizeof(buf) - strlen(buf));
av_strlcatf(buf, sizeof(buf), "\n");
avio_write(s->pb, buf, strlen(buf));
avio_flush(s->pb);
}
return 0;

View File

@ -171,8 +171,6 @@ static int mmf_write_trailer(AVFormatContext *s)
avio_write(pb, "\x00\x00\x00\x00", 4);
avio_seek(pb, pos, SEEK_SET);
avio_flush(pb);
}
return 0;
}

View File

@ -1244,7 +1244,6 @@ static int mpeg_mux_end(AVFormatContext *ctx)
* it as it is usually not needed by decoders and because it
* complicates MPEG stream concatenation. */
// avio_wb32(ctx->pb, ISO_11172_END_CODE);
// avio_flush(ctx->pb);
for (i = 0; i < ctx->nb_streams; i++) {
stream = ctx->streams[i]->priv_data;

View File

@ -99,8 +99,6 @@ static int sox_write_trailer(AVFormatContext *s)
} else
avio_wb64(pb, num_samples);
avio_seek(pb, file_size, SEEK_SET);
avio_flush(pb);
}
return 0;

View File

@ -154,7 +154,6 @@ static int tta_write_trailer(AVFormatContext *s)
tta_queue_flush(s);
ff_ape_write_tag(s);
avio_flush(s->pb);
return 0;
}

View File

@ -76,7 +76,6 @@ static int vc1test_write_trailer(AVFormatContext *s)
if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) {
avio_seek(pb, 0, SEEK_SET);
avio_wl24(pb, ctx->frames);
avio_flush(pb);
}
return 0;
}

View File

@ -478,7 +478,6 @@ static int wav_write_trailer(AVFormatContext *s)
avio_wl32(pb, -1);
avio_seek(pb, file_size, SEEK_SET);
avio_flush(pb);
}
}
@ -605,7 +604,6 @@ static int w64_write_trailer(AVFormatContext *s)
}
avio_seek(pb, file_size, SEEK_SET);
avio_flush(pb);
}
return 0;

View File

@ -823,8 +823,6 @@ static int write_trailer(AVFormatContext *s)
avio_seek(pb, 0x5c, SEEK_SET);
avio_wl32(pb, file_end_pos >> WTV_SECTOR_BITS);
avio_flush(pb);
av_free(wctx->sp_pairs);
av_free(wctx->st_pairs);
av_packet_unref(&wctx->thumbnail);