Commit a6593f7c authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mpegts: Do not add pid if its already there with add_pid_to_pmt()

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 716674b1
......@@ -299,11 +299,17 @@ static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid,
unsigned int pid)
{
struct Program *p = get_program(ts, programid);
int i;
if (!p)
return;
if (p->nb_pids >= MAX_PIDS_PER_PROGRAM)
return;
for (i = 0; i < MAX_PIDS_PER_PROGRAM; i++)
if (p->pids[i] == pid)
return;
p->pids[p->nb_pids++] = pid;
}
......
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