mpegts: Update the PSI/SI table only if the version change
authorJohn Högberg <john.hogberg@ericsson.com>
Tue, 28 Apr 2015 08:20:33 +0000 (10:20 +0200)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 19 May 2015 11:13:23 +0000 (12:13 +0100)
commit844201e35fe575710be8218d45828df49b77f205
treede4733d1c7162941edd4f3481ea0ab1fba713a5f
parentf77c9d71615e17414aacbb1720693b800a5a32d3
mpegts: Update the PSI/SI table only if the version change

If a PAT is finished while a PMT section filter is opened but
not yet finished, the PMT section filter is closed and all
the received data is discarded.

This is usually not an issue but some multiplexers (With very
quick PAT/PMT repetition settings) consistently emit a PMT
section start, then a PAT, and then the rest of the PMT,
causing the aforementioned behavior to result in no PMT being
finished.

In the most pathologic situation the stream information are lost
and the probe fallback miscategorizes subtitles as mp3 audio.

Avoid the issue through eliminating redundant PSI/SI table
updates by checking their version field, which is required by
the standard to be incremented on every change no matter how
minor.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavformat/mpegts.c