Browse Source

mpegts: only reopen pmt_cb filter if its different from the previous.

Fixes Ticket2632

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.0
Michael Niedermayer 12 years ago
parent
commit
b009267910
1 changed files with 9 additions and 3 deletions
  1. +9
    -3
      libavformat/mpegts.c

+ 9
- 3
libavformat/mpegts.c View File

@@ -1625,12 +1625,18 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
if (sid == 0x0000) { if (sid == 0x0000) {
/* NIT info */ /* NIT info */
} else { } else {
MpegTSFilter *fil = ts->pids[pmt_pid];
program = av_new_program(ts->stream, sid); program = av_new_program(ts->stream, sid);
program->program_num = sid; program->program_num = sid;
program->pmt_pid = pmt_pid; program->pmt_pid = pmt_pid;
if (ts->pids[pmt_pid])
mpegts_close_filter(ts, ts->pids[pmt_pid]);
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
if (fil)
if ( fil->type != MPEGTS_SECTION
|| fil->pid != pmt_pid
|| fil->u.section_filter.section_cb != pmt_cb)
mpegts_close_filter(ts, ts->pids[pmt_pid]);

if (!ts->pids[pmt_pid])
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
add_pat_entry(ts, sid); add_pat_entry(ts, sid);
add_pid_to_pmt(ts, sid, 0); //add pat pid to program add_pid_to_pmt(ts, sid, 0); //add pat pid to program
add_pid_to_pmt(ts, sid, pmt_pid); add_pid_to_pmt(ts, sid, pmt_pid);


Loading…
Cancel
Save