[FFmpeg-cvslog] avformat/mpegts: never discard PAT pid

Marton Balint git at videolan.org
Sun Jan 10 01:26:06 EET 2021


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Dec 27 17:35:36 2020 +0100| [5ea37923a8aaa3f670c1455c783c10d3142f4a71] | committer: Marton Balint

avformat/mpegts: never discard PAT pid

PID 0 was removed from the pid list when then PMT was parsed, it is better
to explictly avoid it from being discarded instead of keeing it in the list of
every program.

Signed-off-by: Marton Balint <cus at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5ea37923a8aaa3f670c1455c783c10d3142f4a71
---

 libavformat/mpegts.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index efff5130de..3712dad1c8 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -380,6 +380,9 @@ static int discard_pid(MpegTSContext *ts, unsigned int pid)
     int used = 0, discarded = 0;
     struct Program *p;
 
+    if (pid == PAT_PID)
+        return 0;
+
     /* If none of the programs have .discard=AVDISCARD_ALL then there's
      * no way we have to discard this packet */
     for (k = 0; k < ts->stream->nb_programs; k++)
@@ -2543,7 +2546,6 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
             if (!ts->pids[pmt_pid])
                 mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
             add_pat_entry(ts, sid);
-            add_pid_to_pmt(ts, sid, 0); // add pat pid to program
             add_pid_to_pmt(ts, sid, pmt_pid);
         }
     }



More information about the ffmpeg-cvslog mailing list