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

Function create_subcc_streams

libavdevice/lavfi.c:75–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75static int create_subcc_streams(AVFormatContext *avctx)
76{
77 LavfiContext *lavfi = avctx->priv_data;
78 AVStream *st;
79 int stream_idx, sink_idx;
80 AVRational *time_base;
81
82 for (stream_idx = 0; stream_idx < lavfi->nb_sinks; stream_idx++) {
83 sink_idx = lavfi->stream_sink_map[stream_idx];
84 if (lavfi->sink_stream_subcc_map[sink_idx]) {
85 lavfi->sink_stream_subcc_map[sink_idx] = avctx->nb_streams;
86 if (!(st = avformat_new_stream(avctx, NULL)))
87 return AVERROR(ENOMEM);
88 st->codecpar->codec_id = AV_CODEC_ID_EIA_608;
89 st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
90 time_base = &avctx->streams[stream_idx]->time_base;
91 st->time_base.num = time_base->num;
92 st->time_base.den = time_base->den;
93 } else {
94 lavfi->sink_stream_subcc_map[sink_idx] = -1;
95 }
96 }
97 return 0;
98}
99
100av_cold static int lavfi_read_header(AVFormatContext *avctx)
101{

Callers 1

lavfi_read_headerFunction · 0.85

Calls 1

avformat_new_streamFunction · 0.85

Tested by

no test coverage detected