| 2532 | } |
| 2533 | |
| 2534 | AVProgram *av_new_program(AVFormatContext *ac, int id) |
| 2535 | { |
| 2536 | AVProgram *program=NULL; |
| 2537 | int i; |
| 2538 | |
| 2539 | #ifdef DEBUG_SI |
| 2540 | av_log(ac, AV_LOG_DEBUG, "new_program: id=0x%04x\n", id); |
| 2541 | #endif |
| 2542 | |
| 2543 | for(i=0; i<ac->nb_programs; i++) |
| 2544 | if(ac->programs[i]->id == id) |
| 2545 | program = ac->programs[i]; |
| 2546 | |
| 2547 | if(!program){ |
| 2548 | program = av_mallocz(sizeof(AVProgram)); |
| 2549 | if (!program) |
| 2550 | return NULL; |
| 2551 | dynarray_add(&ac->programs, &ac->nb_programs, program); |
| 2552 | program->discard = AVDISCARD_NONE; |
| 2553 | } |
| 2554 | program->id = id; |
| 2555 | |
| 2556 | return program; |
| 2557 | } |
| 2558 | |
| 2559 | AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title) |
| 2560 | { |
no test coverage detected