From fe6af54f94f7bb5f91fddf2627fa42e0f210c826 Mon Sep 17 00:00:00 2001 From: Mykola Stepanets Date: Sun, 14 Sep 2025 02:50:36 +0300 Subject: [PATCH] fix packets lost in HLS-TS --- yoRadio/src/audioI2S/Audio.cpp | 10 ++++++---- yoRadio/src/audioI2S/AudioEx.h | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/yoRadio/src/audioI2S/Audio.cpp b/yoRadio/src/audioI2S/Audio.cpp index b717bf2..222d11b 100644 --- a/yoRadio/src/audioI2S/Audio.cpp +++ b/yoRadio/src/audioI2S/Audio.cpp @@ -5,8 +5,8 @@ * * Created on: Oct 26.2018 * - * Version 2.0.5j - * Updated on: Aug 21.2022 + * Version 2.0.5k + * Updated on: Aug 23.2022 * Author: Wolle (schreibfaul1) * */ @@ -326,6 +326,7 @@ void Audio::setDefaults() { _client = static_cast(&client); /* default to *something* so that no NULL deref can happen */ } playI2Sremains(); + ts_parsePacket(0, 0, 0); // reset ts routine AUDIO_INFO("buffers freed, free Heap: %lu bytes", ESP.getFreeHeap()); @@ -3311,7 +3312,6 @@ void Audio::processWebStreamTS() { tmr_1s = millis(); m_t0 = millis(); ts_packetPtr = 0; - ts_parsePacket(0, 0, 0); // reset ts routine m_controlCounter = 0; m_f_firstCall = false; } @@ -4999,7 +4999,9 @@ bool Audio::ts_parsePacket(uint8_t* packet, uint8_t* packetStart, uint8_t* packe *packetLength = 0; return true; } - if(m_f_Log) log_e("invalid ts packet!"); + // PES received before PAT and PMT seen + *packetStart = 0; + *packetLength = 0; return false; } //---------------------------------------------------------------------------------------------------------------------- diff --git a/yoRadio/src/audioI2S/AudioEx.h b/yoRadio/src/audioI2S/AudioEx.h index b8db6c1..e1ab126 100644 --- a/yoRadio/src/audioI2S/AudioEx.h +++ b/yoRadio/src/audioI2S/AudioEx.h @@ -2,7 +2,7 @@ * Audio.h * * Created on: Oct 28,2018 - * Updated on: Aug 21,2022 + * Updated on: Aug 23,2022 * Author: Wolle (schreibfaul1) */