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

Function seg_write_header

libavformat/segment.c:830–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

828}
829
830static int seg_write_header(AVFormatContext *s)
831{
832 SegmentContext *seg = s->priv_data;
833 AVFormatContext *oc = seg->avf;
834 int ret;
835
836 if (!seg->header_written) {
837 ret = avformat_write_header(oc, NULL);
838 if (ret < 0)
839 return ret;
840 }
841
842 if (!seg->write_header_trailer || seg->header_filename) {
843 if (seg->header_filename) {
844 av_write_frame(oc, NULL);
845 ff_format_io_close(oc, &oc->pb);
846 } else {
847 close_null_ctxp(&oc->pb);
848 seg->is_nullctx = 0;
849 }
850 if ((ret = oc->io_open(oc, &oc->pb, oc->url, AVIO_FLAG_WRITE, NULL)) < 0)
851 return ret;
852 if (!seg->individual_header_trailer)
853 oc->pb->seekable = 0;
854 }
855
856 return 0;
857}
858
859static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
860{

Callers

nothing calls this directly

Calls 4

avformat_write_headerFunction · 0.85
av_write_frameFunction · 0.85
ff_format_io_closeFunction · 0.85
close_null_ctxpFunction · 0.85

Tested by

no test coverage detected