[FFmpeg-devel] [PATCH v2] avformat/mpegts: Fix misdetection of the raw packet size

Marton Balint cus at passwd.hu
Tue May 19 21:49:03 EEST 2020



On Sun, 17 May 2020, lance.lmwang at gmail.com wrote:

> From: Limin Wang <lance.lmwang at gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
> libavformat/mpegts.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 0833d62..4bca339 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -2852,6 +2852,8 @@ static void reanalyze(MpegTSContext *ts) {
>         ts->size_stat[1] ++;
>     } else if (pos == TS_FEC_PACKET_SIZE) {
>         ts->size_stat[2] ++;
> +    } else {
> +        return;
>     }

Okay, so what this patch does is that it skips unrecognized sync byte 
distances entirely. I guess that is OK, but it still not fixes 
not recognizing skipped 0x47 bytes. I will send an alternative patch with 
some more explanation.

Thanks,
Marton


More information about the ffmpeg-devel mailing list