MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / of_write_trailer

Function of_write_trailer

fftools/ffmpeg_mux.c:757–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

755}
756
757int of_write_trailer(OutputFile *of)
758{
759 Muxer *mux = mux_from_of(of);
760 AVFormatContext *fc = mux->fc;
761 int ret, mux_result = 0;
762
763 if (!mux->header_written) {
764 av_log(mux, AV_LOG_ERROR,
765 "Nothing was written into output file, because "
766 "at least one of its streams received no packets.\n");
767 return AVERROR(EINVAL);
768 }
769
770 ret = av_write_trailer(fc);
771 if (ret < 0) {
772 av_log(mux, AV_LOG_ERROR, "Error writing trailer: %s\n", av_err2str(ret));
773 mux_result = err_merge(mux_result, ret);
774 }
775
776 mux->last_filesize = filesize(fc->pb);
777
778 if (!(fc->oformat->flags & AVFMT_NOFILE)) {
779 ret = avio_closep(&fc->pb);
780 if (ret < 0) {
781 av_log(mux, AV_LOG_ERROR, "Error closing file: %s\n", av_err2str(ret));
782 mux_result = err_merge(mux_result, ret);
783 }
784 }
785
786 mux_final_stats(mux);
787
788 // check whether anything was actually written
789 ret = check_written(of);
790 mux_result = err_merge(mux_result, ret);
791
792 return mux_result;
793}
794
795static void enc_stats_uninit(EncStats *es)
796{

Callers 1

transcodeFunction · 0.85

Calls 8

mux_from_ofFunction · 0.85
av_logFunction · 0.85
av_write_trailerFunction · 0.85
err_mergeFunction · 0.85
filesizeFunction · 0.85
avio_closepFunction · 0.85
mux_final_statsFunction · 0.85
check_writtenFunction · 0.85

Tested by

no test coverage detected