]> git.sesse.net Git - ffmpeg/commitdiff
avformat: remove unneeded avio_flush() calls from the end of write_trailer functions
authorMarton Balint <cus@passwd.hu>
Sat, 4 Jan 2020 18:31:14 +0000 (19:31 +0100)
committerMarton Balint <cus@passwd.hu>
Tue, 7 Jan 2020 20:51:45 +0000 (21:51 +0100)
The IO context is always flushed by libavformat/mux.c after write_trailer is
called, so this change should have no effect at all.

13 files changed:
libavformat/aiffenc.c
libavformat/astenc.c
libavformat/au.c
libavformat/cafenc.c
libavformat/flacenc.c
libavformat/hashenc.c
libavformat/mmf.c
libavformat/mpegenc.c
libavformat/soxenc.c
libavformat/ttaenc.c
libavformat/vc1testenc.c
libavformat/wavenc.c
libavformat/wtvenc.c

index ec2c7db09abb03aacd3c47fbbb61e35e061a80d5..0145596bec8f30f31363bab7e9524c2f7d33f1a4 100644 (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;
index d38a3aab38b6e0f8f52ea0b790141942a5405d50..e0b94b8b632ba811d3b6ea2449fc5b2dcb0e7878 100644 (file)
@@ -178,7 +178,6 @@ static int ast_write_trailer(AVFormatContext *s)
         }
 
         avio_seek(pb, file_size, SEEK_SET);
-        avio_flush(pb);
     }
     return 0;
 }
index 19a0f569636cfb8cbb1df8b143a49f2e99e5d7f7..4afee85a948e3a1787efd42457e05395a8724bd4 100644 (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;
index 8fe1dcef19c1ac3024bee18fcac726e0ae205da7..98d4d9212f088383552bf73954a5507d98998a21 100644 (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;
index abbed38f89bf07f961147b4a4542f272cd1c2b7e..1aae0c97e0f8b203a49b56521cf5d7da6e2190b2 100644 (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");
     }
index 34a8fd1f5087ce8a76540e992b2f13711505044c..ddc67f53b5007dd89ee3b0691c61bd4bfbfdc84f 100644 (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;
index 4e087fc9203eb85851ecebe5aec0b163100a4aac..e4768db0646154f74015b3196616008007fb0f54 100644 (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;
 }
index f6980231a20d19fdf0755acde39a904a419b2482..f8039a42c07ee086890f151cbaf0a24fb6e820f5 100644 (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;
index 7259131b036dd2bc42480fbb3cf0035806d05382..ce276f88b5d917feaed594b8251a4ca7a682664a 100644 (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;
index 73c29ae936c268100b913730def90bd0c6fa1ae2..4860aab4c13468904797571e61fc5cc42ee0ddd2 100644 (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;
 }
index cf95d1d80d2f7d0ef3e6109b15579fb6396fa413..1365bdd660ee7ad8dd734b0d1f2410972073ffb6 100644 (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;
 }
index c44d6d26e9d591b3ee3d08cd85d93c90f362e197..ea7573139cb63984a102c5c5bc471340b63b7a3b 100644 (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;
index 4a68b8133f9973c60ac67efdf6d7455916fad264..498bc64019551ac210b7f883068c5b17c016d360 100644 (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);