aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/mpegts.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-03 22:23:54 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-03 22:25:55 +0100
commita6593f7cc6e4aeebcae4a0f74ca105940379419e (patch)
treea4e986c5e6986418095c88a16ddaee8938edd013 /libavformat/mpegts.c
parent716674b151c15b465e98630108845a228a136793 (diff)
downloadffmpeg-a6593f7cc6e4aeebcae4a0f74ca105940379419e.tar.gz
avformat/mpegts: Do not add pid if its already there with add_pid_to_pmt()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mpegts.c')
-rw-r--r--libavformat/mpegts.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index c01f954c84..8e639e092f 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -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;
}