[FFmpeg-cvslog] r9208 - trunk/libavformat/mpegts.c

michael subversion
Mon Jun 4 16:44:52 CEST 2007


Author: michael
Date: Mon Jun  4 16:44:52 2007
New Revision: 9208

Log:
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)


Modified:
   trunk/libavformat/mpegts.c

Modified: trunk/libavformat/mpegts.c
==============================================================================
--- trunk/libavformat/mpegts.c	(original)
+++ trunk/libavformat/mpegts.c	Mon Jun  4 16:44:52 2007
@@ -600,6 +600,7 @@ static void pat_cb(MpegTSFilter *filter,
         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,
     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(MpegTSContex
                                                 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(AVFormatCo
         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);




More information about the ffmpeg-cvslog mailing list