av_hex_dump((uint8_t *)section, section_len);
av_hex_dump(stdout, (uint8_t *)section, section_len);
static void pat_scan_cb(void *opaque, const uint8_t *section, int section_len){    MpegTSContext *ts = opaque;    SectionHeader h1, *h = &h1;    const uint8_t *p, *p_end;    int sid, pmt_pid;    char *provider_name, *name;    char buf[256];#ifdef DEBUG_SI    printf("PAT:\n");    av_hex_dump((uint8_t *)section, section_len);#endif    p_end = section + section_len - 4;    p = section;    if (parse_section_header(h, &p, p_end) < 0)        return;    if (h->tid != PAT_TID)        return;    for(;;) {        sid = get16(&p, p_end);        if (sid < 0)            break;        pmt_pid = get16(&p, p_end) & 0x1fff;        if (pmt_pid < 0)            break;#ifdef DEBUG_SI        printf("sid=0x%x pid=0x%x\n", sid, pmt_pid);#endif        if (sid == 0x0000) {            /* NIT info */        } else {            /* add the service with a dummy name */            snprintf(buf, sizeof(buf), "Service %x\n", sid);            name = av_strdup(buf);            provider_name = av_strdup("");            if (name && provider_name) {                new_service(ts, sid, provider_name, name);            } else {                av_freep(&name);                av_freep(&provider_name);            }        }    }    ts->stop_parse = 1;    /* remove filter */    mpegts_close_filter(ts, ts->pat_filter);    ts->pat_filter = NULL;}