From 3d44c772acaeaafb299b6960c5fd058194cadbac Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Fri, 24 Dec 2021 19:58:27 +0800 Subject: [PATCH] =?UTF-8?q?HLS:=20hls=E6=92=AD=E6=94=BE=E5=99=A8=E8=A7=A3?= =?UTF-8?q?=E6=9E=90ts=E5=A4=B1=E8=B4=A5=E6=97=B6=EF=BC=8C=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E6=95=B0=E6=8D=AE=E4=BB=A5=E4=BE=BF=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E6=92=AD=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Http/HlsPlayer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Http/HlsPlayer.cpp b/src/Http/HlsPlayer.cpp index 5363c478..246ef8b1 100644 --- a/src/Http/HlsPlayer.cpp +++ b/src/Http/HlsPlayer.cpp @@ -259,7 +259,13 @@ void HlsPlayer::playDelay() { } void HlsPlayer::onPacket_l(const char *data, size_t len) { - _segment.input(data, len); + try { + _segment.input(data, len); + } catch (...) { + //ts解析失败,清空缓存数据 + _segment.reset(); + throw; + } } //////////////////////////////////////////////////////////////////////////