Revision 9deb6d71

View differences:

libavformat/mpegts.c
111 111
    /** list of PMTs in the last PAT seen                    */
112 112
    MpegTSService **services;
113 113

  
114
    /* set service context (XXX: allocated it ?) */
115
    SetServiceCallback *set_service_cb;
116
    void *set_service_opaque;
117 114
    /** filter for the PAT                                   */
118 115
    MpegTSFilter *pat_filter;
119 116
    /** filter for the PMT for the MPEG program number specified by req_sid */
......
529 526
        }
530 527
    }
531 528
    /* all parameters are there */
532
    ts->set_service_cb(ts->set_service_opaque, 0);
529
    ts->stop_parse=1;
533 530
    mpegts_close_filter(ts, ts->pmt_filter);
534 531
    ts->pmt_filter = NULL;
535 532
}
......
573 570
        }
574 571
    }
575 572
    /* not found */
576
    ts->set_service_cb(ts->set_service_opaque, -1);
573
    ts->stop_parse=1;
577 574

  
578 575
 found:
579 576
    mpegts_close_filter(ts, ts->pat_filter);
......
633 630
    ts->pat_filter = NULL;
634 631
}
635 632

  
636
static void mpegts_set_service(MpegTSContext *ts, int sid,
637
                        SetServiceCallback *set_service_cb, void *opaque)
633
static void mpegts_set_service(MpegTSContext *ts, int sid)
638 634
{
639
    ts->set_service_cb = set_service_cb;
640
    ts->set_service_opaque = opaque;
641 635
    ts->req_sid = sid;
642 636
    ts->pat_filter = mpegts_open_section_filter(ts, PAT_PID,
643 637
                                                pat_cb, ts, 1);
......
1158 1152
#endif
1159 1153
}
1160 1154

  
1161
static void set_service_cb(void *opaque, int ret)
1162
{
1163
    MpegTSContext *ts = opaque;
1164
    ts->stop_parse = 1;
1165
}
1166

  
1167 1155
/* return the 90 kHz PCR and the extension for the 27 MHz PCR. return
1168 1156
   (-1) if not available */
1169 1157
static int parse_pcr(int64_t *ppcr_high, int *ppcr_low,
......
1266 1254
                otherwise try to filter all PATs */
1267 1255

  
1268 1256
                url_fseek(pb, pos, SEEK_SET);
1269
                mpegts_set_service(ts, sid, set_service_cb, ts);
1257
                mpegts_set_service(ts, sid);
1270 1258

  
1271 1259
                handle_packets(ts, s->probesize);
1272 1260
            }

Also available in: Unified diff