AI: SRT: Stop TS parsing in SrsSrtFormat after codec detection. v7.0.125 (#4569) (#4571)

Fix log flooding issue when processing SRT streams containing SCTE-35
PIDs or other unrecognized stream types.

The `SrsSrtFormat::on_srt_packet()` method continuously parses TS
packets throughout the entire stream lifetime. The TS parser logs
warnings for every unrecognized stream type (like SCTE-35) in the PMT,
causing log flooding.

However, `SrsFormat` is only used to detect audio/video codec
information. Once both codecs are detected, there's no need to continue
parsing TS packets.

Note: This fix mitigates the problem - there will still be some warning
logs during the initial codec detection phase (typically 5-10 seconds),
but the continuous log flooding after codec detection is completely
eliminated.
This commit is contained in:
OSSRS-AI 2025-11-11 00:24:01 -05:00 committed by GitHub
parent e509d079a2
commit 3f2539d8fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,7 @@ The changelog for SRS.
<a name="v7-changes"></a> <a name="v7-changes"></a>
## SRS 7.0 Changelog ## SRS 7.0 Changelog
* v7.0, 2025-11-11, AI: SRT: Stop TS parsing after codec detection. v7.0.125 (#4569)
* v7.0, 2025-11-09, AI: WebRTC: Support G.711 (PCMU/PCMA) audio codec for WebRTC. v7.0.124 (#4075) * v7.0, 2025-11-09, AI: WebRTC: Support G.711 (PCMU/PCMA) audio codec for WebRTC. v7.0.124 (#4075)
* v7.0, 2025-11-08, AI: WebRTC: Support VP9 codec for WebRTC-to-WebRTC streaming. v7.0.123 (#4548) * v7.0, 2025-11-08, AI: WebRTC: Support VP9 codec for WebRTC-to-WebRTC streaming. v7.0.123 (#4548)
* v7.0, 2025-11-08, AI: API: Add audio_frames and video_frames to HTTP API. v7.0.122 (#4559) * v7.0, 2025-11-08, AI: API: Add audio_frames and video_frames to HTTP API. v7.0.122 (#4559)

View File

@ -969,6 +969,12 @@ srs_error_t SrsSrtFormat::on_srt_packet(SrsSrtPacket *pkt)
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
// Skip TS parsing if both video and audio codecs have been reported
// This avoids unnecessary TS decoding and log flooding from unrecognized stream types
if (video_codec_reported_ && audio_codec_reported_) {
return err;
}
char *buf = pkt->data(); char *buf = pkt->data();
int nb_buf = pkt->size(); int nb_buf = pkt->size();

View File

@ -9,6 +9,6 @@
#define VERSION_MAJOR 7 #define VERSION_MAJOR 7
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_REVISION 124 #define VERSION_REVISION 125
#endif #endif