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

Function av_new_program

libavformat/avformat.c:271–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269}
270
271AVProgram *av_new_program(AVFormatContext *ac, int id)
272{
273 AVProgram *program = NULL;
274 int ret;
275
276 av_log(ac, AV_LOG_TRACE, "new_program: id=0x%04x\n", id);
277
278 for (unsigned i = 0; i < ac->nb_programs; i++)
279 if (ac->programs[i]->id == id)
280 program = ac->programs[i];
281
282 if (!program) {
283 program = av_mallocz(sizeof(*program));
284 if (!program)
285 return NULL;
286 ret = av_dynarray_add_nofree(&ac->programs, &ac->nb_programs, program);
287 if (ret < 0) {
288 av_free(program);
289 return NULL;
290 }
291 program->discard = AVDISCARD_NONE;
292 program->pmt_version = -1;
293 program->id = id;
294 program->pts_wrap_reference = AV_NOPTS_VALUE;
295 program->pts_wrap_behavior = AV_PTS_WRAP_IGNORE;
296 program->start_time =
297 program->end_time = AV_NOPTS_VALUE;
298 }
299 return program;
300}
301
302void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned idx)
303{

Callers 5

dash_read_headerFunction · 0.85
pat_cbFunction · 0.85
sdt_cbFunction · 0.85
hls_read_headerFunction · 0.85
of_add_programsFunction · 0.85

Calls 4

av_logFunction · 0.85
av_dynarray_add_nofreeFunction · 0.85
av_malloczFunction · 0.50
av_freeFunction · 0.50

Tested by

no test coverage detected