On Tue, Apr 28, 2015 at 08:44:55AM +0000, John Högberg wrote:
> From b5bb543d288ef160d494315f0b2ea5a11d5efbaa Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?John=20H=C3=B6gberg?= <[email protected]>
> Date: Tue, 28 Apr 2015 10:20:33 +0200
> Subject: [PATCH] mpegts: fix degradation when PAT arrives while reading PMT.
> 
> 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. On the worst set of streams I tested 
> libav was completely unable to read the stream information and always had to 
> fall back to probing, resulting in it interpreting DVB subtitle tracks as MP3 
> audio.
> 
> This commit fixes 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. The way the demux is set 
> up the bug itself looks unavoidable without a rewrite, but preventing a 
> second *unaltered* PAT from closing the PMT section filter makes it behave 
> properly with a delay of one PMT repetition.

Please keep line length in log messages reasonable.

> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -372,6 +373,8 @@ static MpegTSFilter 
> *mpegts_open_section_filter(MpegTSContext *ts,
>      sec->opaque      = opaque;
>      sec->section_buf = av_malloc(MAX_SECTION_SIZE);
>      sec->check_crc   = check_crc;
> +    sec->last_ver = -1;

Please maintain vertical alignment of = here.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to