| 593 | }; |
| 594 | |
| 595 | Scheduler *sch_alloc(void) |
| 596 | { |
| 597 | Scheduler *sch; |
| 598 | int ret; |
| 599 | |
| 600 | sch = av_mallocz(sizeof(*sch)); |
| 601 | if (!sch) |
| 602 | return NULL; |
| 603 | |
| 604 | sch->class = &scheduler_class; |
| 605 | sch->sdp_auto = 1; |
| 606 | |
| 607 | ret = pthread_mutex_init(&sch->schedule_lock, NULL); |
| 608 | if (ret) |
| 609 | goto fail; |
| 610 | |
| 611 | ret = pthread_mutex_init(&sch->mux_ready_lock, NULL); |
| 612 | if (ret) |
| 613 | goto fail; |
| 614 | |
| 615 | ret = pthread_mutex_init(&sch->finish_lock, NULL); |
| 616 | if (ret) |
| 617 | goto fail; |
| 618 | |
| 619 | ret = pthread_cond_init(&sch->finish_cond, NULL); |
| 620 | if (ret) |
| 621 | goto fail; |
| 622 | |
| 623 | return sch; |
| 624 | fail: |
| 625 | sch_free(&sch); |
| 626 | return NULL; |
| 627 | } |
| 628 | |
| 629 | int sch_sdp_filename(Scheduler *sch, const char *sdp_filename) |
| 630 | { |
no test coverage detected