| 828 | } |
| 829 | |
| 830 | static 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 | |
| 859 | static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) |
| 860 | { |
nothing calls this directly
no test coverage detected