| 2763 | } |
| 2764 | |
| 2765 | static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) |
| 2766 | { |
| 2767 | MpegTSContext *ts = filter->u.section_filter.opaque; |
| 2768 | MpegTSSectionFilter *tssf = &filter->u.section_filter; |
| 2769 | SectionHeader h1, *h = &h1; |
| 2770 | const uint8_t *p, *p_end; |
| 2771 | int sid, pmt_pid; |
| 2772 | int nb_prg = 0; |
| 2773 | AVProgram *program; |
| 2774 | |
| 2775 | av_log(ts->stream, AV_LOG_TRACE, "PAT:\n"); |
| 2776 | hex_dump_debug(ts->stream, section, section_len); |
| 2777 | |
| 2778 | p_end = section + section_len - 4; |
| 2779 | p = section; |
| 2780 | if (parse_section_header(h, &p, p_end) < 0) |
| 2781 | return; |
| 2782 | if (h->tid != PAT_TID) |
| 2783 | return; |
| 2784 | if (!h->current_next) |
| 2785 | return; |
| 2786 | if (ts->skip_changes) |
| 2787 | return; |
| 2788 | |
| 2789 | if (skip_identical(h, tssf)) |
| 2790 | return; |
| 2791 | ts->id = h->id; |
| 2792 | |
| 2793 | for (;;) { |
| 2794 | sid = get16(&p, p_end); |
| 2795 | if (sid < 0) |
| 2796 | break; |
| 2797 | pmt_pid = get16(&p, p_end); |
| 2798 | if (pmt_pid < 0) |
| 2799 | break; |
| 2800 | pmt_pid &= 0x1fff; |
| 2801 | |
| 2802 | if (pmt_pid == ts->current_pid) |
| 2803 | break; |
| 2804 | |
| 2805 | av_log(ts->stream, AV_LOG_TRACE, "sid=0x%x pid=0x%x\n", sid, pmt_pid); |
| 2806 | |
| 2807 | if (sid == 0x0000) { |
| 2808 | /* NIT info */ |
| 2809 | } else { |
| 2810 | MpegTSFilter *fil = ts->pids[pmt_pid]; |
| 2811 | struct Program *prg; |
| 2812 | program = av_new_program(ts->stream, sid); |
| 2813 | if (program) { |
| 2814 | program->program_num = sid; |
| 2815 | program->pmt_pid = pmt_pid; |
| 2816 | } |
| 2817 | if (fil) |
| 2818 | if ( fil->type != MPEGTS_SECTION |
| 2819 | || fil->pid != pmt_pid |
| 2820 | || fil->u.section_filter.section_cb != pmt_cb) |
| 2821 | mpegts_close_filter(ts, ts->pids[pmt_pid]); |
| 2822 |
nothing calls this directly
no test coverage detected