From ad39abcdd9018dd619b8cf308e4070ad87253a5e Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 4 Jun 2007 14:44:52 +0000 Subject: remove duplicate PAT scaning code and actual PAT scan also disabling the nonsense 3yr old rawts change (it would after the above chage totally break the demuxer if its left enabled) Originally committed as revision 9208 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/mpegts.c | 59 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 57 deletions(-) (limited to 'libavformat/mpegts.c') diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 89c6557e44..d2463e06d1 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -600,6 +600,7 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len if (sid == 0x0000) { /* NIT info */ } else { + new_service(ts, sid, NULL, NULL); ts->stop_parse--; mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1); @@ -611,47 +612,6 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len mpegts_close_filter(ts, filter); } -/* add all services found in the PAT */ -static void pat_scan_cb(MpegTSFilter *filter, const uint8_t *section, int section_len) -{ - MpegTSContext *ts = filter->u.section_filter.opaque; - SectionHeader h1, *h = &h1; - const uint8_t *p, *p_end; - int sid, pmt_pid; - -#ifdef DEBUG_SI - av_log(ts->stream, AV_LOG_DEBUG, "PAT:\n"); - av_hex_dump_log(ts->stream, AV_LOG_DEBUG, (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 - av_log(ts->stream, AV_LOG_DEBUG, "sid=0x%x pid=0x%x\n", sid, pmt_pid); -#endif - if (sid == 0x0000) { - /* NIT info */ - } else { - new_service(ts, sid, NULL, NULL); - } - } - ts->stop_parse = 1; - - /* remove filter */ - mpegts_close_filter(ts, filter); -} - static void mpegts_set_service(MpegTSContext *ts) { mpegts_open_section_filter(ts, PAT_PID, @@ -737,14 +697,6 @@ static void mpegts_scan_sdt(MpegTSContext *ts) sdt_cb, ts, 1); } -/* scan services in a transport stream by looking at the PAT (better - than nothing !) */ -static void mpegts_scan_pat(MpegTSContext *ts) -{ - mpegts_open_section_filter(ts, PAT_PID, - pat_scan_cb, ts, 1); -} - static int64_t get_pts(const uint8_t *p) { int64_t pts; @@ -1204,20 +1156,13 @@ static int mpegts_read_header(AVFormatContext *s, url_fseek(pb, pos, SEEK_SET); mpegts_scan_sdt(ts); - if (ts->nb_services <= 0) { - mpegts_scan_pat(ts); - - handle_packets(ts, s->probesize); - } - - if (ts->nb_services <= 0) { + if (ts->nb_services <= 0 && 0) { /* raw transport stream */ ts->auto_guess = 1; s->ctx_flags |= AVFMTCTX_NOHEADER; goto do_pcr; } - url_fseek(pb, pos, SEEK_SET); mpegts_set_service(ts); handle_packets(ts, s->probesize); -- cgit v1.2.3