MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ close()

void MayaFlux::IO::FFmpegMuxContext::close ( )

Write the container trailer, flush avio, and release all resources.

av_write_trailer is called only if write_header() previously succeeded. Safe to call multiple times or on a context that was never successfully opened.

Definition at line 63 of file FFmpegMuxContext.cpp.

64{
65 if (!format_context)
66 return;
67
68 if (m_header_written) {
69 av_write_trailer(format_context);
70 m_header_written = false;
71 }
72
73 if (format_context->pb && !(format_context->oformat->flags & AVFMT_NOFILE))
74 avio_closep(&format_context->pb);
75
76 avformat_free_context(format_context);
77 format_context = nullptr;
78 m_last_error.clear();
79}
AVFormatContext * format_context
Owned; freed in close().

References format_context, m_header_written, and m_last_error.

Referenced by open(), MayaFlux::IO::SoundFileWriter::worker_loop(), MayaFlux::IO::VideoFileWriter::worker_loop(), and ~FFmpegMuxContext().

+ Here is the caller graph for this function: