Fix error about TestRtcPublish_HttpFlvPlay. v7.0.36 (#4363)

In the scenario of converting WebRTC to RTMP, this conversion will not
proceed until an SenderReport is received; for reference, see:
https://github.com/ossrs/srs/pull/2470.
Thus, if HTTP-FLV streaming is attempted before the SR is received, the
FLV Header will contain only audio, devoid of video content.
This error can be resolved by disabling `guess_has_av` in the
configuration file, since we can guarantee that both audio and video are
present in the test cases.

However, in the original regression tests, the
`TestRtcPublish_HttpFlvPlay` test case contains a bug:

5a404c089b/trunk/3rdparty/srs-bench/srs/rtc_test.go (L2421-L2424)

The test would pass when `hasAudio` is true and `hasVideo` is false,
which is actually incorrect. Therefore, it has been revised so that the
test now only passes if both values are true.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: winlin <winlinvip@gmail.com>
This commit is contained in:
Haibo Chen(陈海博) 2025-05-29 23:21:15 +08:00 committed by winlin
parent 9c559dcb48
commit 33b0a0fe7d
9 changed files with 32 additions and 7 deletions

View File

@ -81,8 +81,10 @@ jobs:
run: |
WORKDIR=$(cygpath -u $SRS_WORKSPACE) && export PATH=/usr/bin:/usr/local/bin && cd ${WORKDIR} &&
pwd && rm -rf /usr/local/srs-cache && mkdir -p /usr/local/srs-cache/srs/trunk && ls -lh &&
tar xf objs.tar.bz2 -C /usr/local/srs-cache/srs/trunk/ && du -sh /usr/local/srs-cache/srs/trunk/* &&
cd ${WORKDIR}/trunk && ./configure --h265=on --gb28181=on --utest=on && ls -lh && du -sh * && du -sh objs/* &&
tar xf objs.tar.bz2 -C /usr/local/srs-cache/srs/trunk/ &&
du -sh /usr/local/srs-cache/srs/trunk/* && du -sh /usr/local/srs-cache/srs/trunk/objs/* &&
cd ${WORKDIR}/trunk && ./configure --h265=on --gb28181=on --utest=on &&
ls -lh && du -sh * && du -sh objs/* &&
cd ${WORKDIR}/trunk && make utest && ./objs/srs_utest
runs-on: windows-latest

14
.vscode/README.md vendored
View File

@ -67,6 +67,20 @@ Then you will discover all the unit testcases from the `View > Testing` panel. Y
open utest source file like `trunk/src/utest/srs_utest.cpp`, then click the `Run Test` or `Debug Test`
on each testcase such as `FastSampleInt64Test`.
## macOS: SRS Regression Test
Follow the [srs-bench](../trunk/3rdparty/srs-bench/README.md) to setup the environment.
Open the test panel by clicking `View > Testing`, run the regression tests under:
```
+ Go
+ github.com/ossrs/srs-bench
+ blackbox
+ gb28181
+ srs
```
## macOS: Proxy
Install the following extensions:

View File

@ -66,6 +66,10 @@ To learn more about RTMP, HLS, HTTP-FLV, SRT, MPEG-DASH, WebRTC protocols, clust
HTTP API, DVR, and transcoding, please check the documents in [English](https://ossrs.io)
or [Chinese](https://ossrs.net).
If you want to use an IDE, VSCode is recommanded. VSCode supports macOS, Linux, and Windows
platforms. The settings are ready. All you need to do is open the folder with VSCode and
enjoy the efficiency brought by the IDE. See [VSCode README](.vscode/README.md) for details.
## Sponsor
Would you like additional assistance from us? By becoming a sponsor or backer of SRS, we can provide you

View File

@ -14,7 +14,7 @@ git clone -b feature/rtc https://github.com/ossrs/srs-bench.git &&
cd srs-bench && make
```
> Note: 依赖Go编译工具建议使用 Go 1.17 及以上的版本。
> Note: 依赖Go编译工具建议使用 Go 1.21 及以上的版本。
编译会生成下面的工具:

View File

@ -2418,7 +2418,7 @@ func TestRtcPublish_HttpFlvPlay(t *testing.T) {
}
logger.Tf(ctx, "got %v tag, %v %vms %vB", nnVideo+nnAudio, tagType, timestamp, len(tag))
if audioPacketsOK, videoPacketsOK := !hasAudio || nnAudio >= 10, !hasVideo || nnVideo >= 10; audioPacketsOK && videoPacketsOK {
if audioPacketsOK, videoPacketsOK := hasAudio && nnAudio >= 10, hasVideo && nnVideo >= 10; audioPacketsOK && videoPacketsOK {
logger.Tf(ctx, "Flv recv %v/%v audio, %v/%v video", hasAudio, nnAudio, hasVideo, nnVideo)
cancel()
}

View File

@ -50,6 +50,8 @@ vhost __defaultVhost__ {
}
http_remux {
enabled on;
# Disabling 'guess_has_av' as it is not required for the current test setup.
guess_has_av off;
mount [vhost]/[app]/[stream].flv;
drop_if_not_match on;
}

View File

@ -50,8 +50,10 @@ vhost __defaultVhost__ {
atc on;
}
http_remux {
enabled on;
mount [vhost]/[app]/[stream].flv;
enabled on;
# Disabling 'guess_has_av' as it is not required for the current test setup.
guess_has_av off;
mount [vhost]/[app]/[stream].flv;
}
ingest livestream {
enabled on;

View File

@ -7,6 +7,7 @@ The changelog for SRS.
<a name="v7-changes"></a>
## SRS 7.0 Changelog
* v7.0, 2025-05-29, Merge [#4363](https://github.com/ossrs/srs/pull/4363): Fix error about TestRtcPublish_HttpFlvPlay. v7.0.36 (#4363)
* v7.0, 2025-05-29, Merge [#4362](https://github.com/ossrs/srs/pull/4362): Update VSCode launch configuration to support GDB on Linux and LLDB on macOS. v7.0.35 (#4362)
* v7.0, 2025-05-26, Merge [#4359](https://github.com/ossrs/srs/pull/4359): update pion/webrtc to v4. v7.0.34 (#4359)
* v7.0, 2025-05-13, Merge [#4289](https://github.com/ossrs/srs/pull/4289): rtmp2rtc: Support RTMP-to-WebRTC conversion with HEVC. v7.0.33 (#4289)

View File

@ -9,6 +9,6 @@
#define VERSION_MAJOR 7
#define VERSION_MINOR 0
#define VERSION_REVISION 35
#define VERSION_REVISION 36
#endif