diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 15:16:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 15:16:35 +0200 |
commit | 5dd8ca7d1b5401d5bfe078f4129db199fe317ad5 (patch) | |
tree | a6f62076e77f0e89e427284976a4a4dd4190de87 /libavformat | |
parent | 4ed0b28a45adf71301ab2030e037ef78eb1974fd (diff) | |
parent | c84ea750cf765c9d8845fca5546eb0ae25b9c855 (diff) | |
download | ffmpeg-5dd8ca7d1b5401d5bfe078f4129db199fe317ad5.tar.gz |
Merge commit 'c84ea750cf765c9d8845fca5546eb0ae25b9c855'
* commit 'c84ea750cf765c9d8845fca5546eb0ae25b9c855':
mpegts: Make discard_pid() faster for single-program streams
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegts.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index afb1767a49..896c96b6e8 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -285,6 +285,17 @@ static int discard_pid(MpegTSContext *ts, unsigned int pid) int i, j, k; int used = 0, discarded = 0; struct Program *p; + + /* If none of the programs have .discard=AVDISCARD_ALL then there's + * no way we have to discard this packet + */ + for (k = 0; k < ts->stream->nb_programs; k++) { + if (ts->stream->programs[k]->discard == AVDISCARD_ALL) + break; + } + if (k == ts->stream->nb_programs) + return 0; + for(i=0; i<ts->nb_prg; i++) { p = &ts->prg[i]; for(j=0; j<p->nb_pids; j++) { |