diff options
author | Marton Balint <cus@passwd.hu> | 2020-01-04 21:14:46 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2020-01-07 21:51:45 +0100 |
commit | f4a8ea7ff6fd83ec925cfd3fccde538196cff85a (patch) | |
tree | 2be7fb737be6340750e5dfee26e07985c6ae56fe /libavformat/wavenc.c | |
parent | c371463915aef11fb8d052fd25313d0444a42cfd (diff) | |
download | ffmpeg-f4a8ea7ff6fd83ec925cfd3fccde538196cff85a.tar.gz |
avformat: remove more unneeded avio_flush() calls
These instances are simply redundant or present because avio_flush() used to be
required before doing a seekback. That is no longer the case, aviobuf code does
the flush automatically on seek.
This only affects code which is either disabled for streaming IO contexts or
does no seekbacks after the flush, so this change should have no adverse effect
on streaming.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/wavenc.c')
-rw-r--r-- | libavformat/wavenc.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/libavformat/wavenc.c b/libavformat/wavenc.c index ea7573139c..f6f5710802 100644 --- a/libavformat/wavenc.c +++ b/libavformat/wavenc.c @@ -411,17 +411,13 @@ static int wav_write_trailer(AVFormatContext *s) int rf64 = 0; int ret = 0; - avio_flush(pb); - if (s->pb->seekable & AVIO_SEEKABLE_NORMAL) { if (wav->write_peak != PEAK_ONLY && avio_tell(pb) - wav->data < UINT32_MAX) { ff_end_tag(pb, wav->data); - avio_flush(pb); } if (wav->write_peak && wav->peak_output) { ret = peak_write_chunk(s); - avio_flush(pb); } /* update file size */ @@ -433,8 +429,6 @@ static int wav_write_trailer(AVFormatContext *s) avio_seek(pb, 4, SEEK_SET); avio_wl32(pb, (uint32_t)(file_size - 8)); avio_seek(pb, file_size, SEEK_SET); - - avio_flush(pb); } else { av_log(s, AV_LOG_ERROR, "Filesize %"PRId64" invalid for wav, output file will be broken\n", @@ -454,7 +448,6 @@ static int wav_write_trailer(AVFormatContext *s) } else { avio_wl32(pb, number_of_samples); avio_seek(pb, file_size, SEEK_SET); - avio_flush(pb); } } |