Skip to content

Commit 3f2539d

Browse files
authored
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.
1 parent e509d07 commit 3f2539d

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

trunk/doc/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ The changelog for SRS.
77
<a name="v7-changes"></a>
88

99
## SRS 7.0 Changelog
10+
* v7.0, 2025-11-11, AI: SRT: Stop TS parsing after codec detection. v7.0.125 (#4569)
1011
* v7.0, 2025-11-09, AI: WebRTC: Support G.711 (PCMU/PCMA) audio codec for WebRTC. v7.0.124 (#4075)
1112
* v7.0, 2025-11-08, AI: WebRTC: Support VP9 codec for WebRTC-to-WebRTC streaming. v7.0.123 (#4548)
1213
* v7.0, 2025-11-08, AI: API: Add audio_frames and video_frames to HTTP API. v7.0.122 (#4559)

trunk/src/app/srs_app_srt_source.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,12 @@ srs_error_t SrsSrtFormat::on_srt_packet(SrsSrtPacket *pkt)
969969
{
970970
srs_error_t err = srs_success;
971971

972+
// Skip TS parsing if both video and audio codecs have been reported
973+
// This avoids unnecessary TS decoding and log flooding from unrecognized stream types
974+
if (video_codec_reported_ && audio_codec_reported_) {
975+
return err;
976+
}
977+
972978
char *buf = pkt->data();
973979
int nb_buf = pkt->size();
974980

trunk/src/core/srs_core_version7.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99

1010
#define VERSION_MAJOR 7
1111
#define VERSION_MINOR 0
12-
#define VERSION_REVISION 124
12+
#define VERSION_REVISION 125
1313

1414
#endif

0 commit comments

Comments
 (0)