[FFmpeg-devel] avformat/mpegts: also ignore new stream in PMT while seeking

Submitted by Yuusei KUWANA on April 17, 2018, 11:48 a.m.

Details

Message ID F6CF9A70-B90F-4C9C-9592-6EBF5968B28D@kumama.org
State New
Headers show

Commit Message

Yuusei KUWANA April 17, 2018, 11:48 a.m.
avformat/mpegts: also ignore new stream in PMT while seeking

Signed-off-by: Yuusei KUWANA <kuwana@kumama.org>
---
 libavformat/mpegts.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Michael Niedermayer April 18, 2018, 8:36 p.m.
On Tue, Apr 17, 2018 at 08:48:23PM +0900, Yuusei KUWANA wrote:
> 
> avformat/mpegts: also ignore new stream in PMT while seeking
> 
> Signed-off-by: Yuusei KUWANA <kuwana@kumama.org>
> ---
>  libavformat/mpegts.c | 4 ++++
>  1 file changed, 4 insertions(+)

This causes a regression with tickets/2471/part.ts

prior 2 programs are detected with streams afterwards only one

file should be here:
https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket2471/

thx

[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 37a6aa8..bd75494 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2043,6 +2043,8 @@  static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
         pid &= 0x1fff;
         if (pid == ts->current_pid)
             goto out;
+        if (ts->skip_changes)
+            goto out;
 
         /* now create stream */
         if (ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES) {
@@ -2066,6 +2068,8 @@  static void pmt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
             }
         } else {
             int idx = ff_find_stream_index(ts->stream, pid);
+            if (ts->skip_changes)
+                goto out;
             if (idx >= 0) {
                 st = ts->stream->streams[idx];
             } else {