Commit 806a66fd authored by Michael Niedermayer's avatar Michael Niedermayer

mpegts: clear avprograms only for removed programs

Fixes Ticket2186

Requested-by: carl
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 07ab8d33
......@@ -209,9 +209,6 @@ static void clear_program(MpegTSContext *ts, unsigned int programid)
static void clear_programs(MpegTSContext *ts)
{
int i;
for(i=0; i<ts->nb_prg; i++)
clear_avprogram(ts, ts->prg[i].id);
av_freep(&ts->prg);
ts->nb_prg=0;
}
......@@ -1638,6 +1635,17 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
add_pid_to_pmt(ts, sid, pmt_pid);
}
}
if (sid < 0) {
int i,j;
for (j=0; j<ts->stream->nb_programs; j++) {
for (i=0; i<ts->nb_prg; i++)
if (ts->prg[i].id == ts->stream->programs[j]->id)
break;
if (i==ts->nb_prg)
clear_avprogram(ts, ts->stream->programs[j]->id);
}
}
}
static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment