Browse Source

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

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

+ 6
- 0
libavformat/mpegts.c View File

@@ -299,11 +299,17 @@ static void add_pid_to_pmt(MpegTSContext *ts, unsigned int programid,
unsigned int pid) unsigned int pid)
{ {
struct Program *p = get_program(ts, programid); struct Program *p = get_program(ts, programid);
int i;
if (!p) if (!p)
return; return;


if (p->nb_pids >= MAX_PIDS_PER_PROGRAM) if (p->nb_pids >= MAX_PIDS_PER_PROGRAM)
return; return;

for (i = 0; i < MAX_PIDS_PER_PROGRAM; i++)
if (p->pids[i] == pid)
return;

p->pids[p->nb_pids++] = pid; p->pids[p->nb_pids++] = pid;
} }




Loading…
Cancel
Save