Fix error about TestRtcPublish_HttpFlvPlay. v7.0.36#4363
Merged
winlinvip merged 5 commits intoossrs:developfrom May 29, 2025
Merged
Fix error about TestRtcPublish_HttpFlvPlay. v7.0.36#4363winlinvip merged 5 commits intoossrs:developfrom
winlinvip merged 5 commits intoossrs:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an error in the TestRtcPublish_HttpFlvPlay test case by ensuring that both audio and video packets are required in the FLV stream. Key changes include:
- Disabling the guess_has_av option in the regression-test configuration file.
- Updating the test condition to fail unless both audio and video are present and meet the minimum packet count.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| trunk/conf/regression-test.conf | Disables guess_has_av to better reflect expected streams. |
| trunk/3rdparty/srs-bench/srs/rtc_test.go | Revises test logic to ensure both audio and video packets are required. |
Comments suppressed due to low confidence (1)
trunk/3rdparty/srs-bench/srs/rtc_test.go:2421
- The updated condition now strictly requires both audio and video packet counts to be met; please verify that this change fully aligns with the intended behavior of the test case.
if audioPacketsOK, videoPacketsOK := hasAudio && nnAudio >= 10, hasVideo && nnVideo >= 10; audioPacketsOK && videoPacketsOK {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
winlinvip
approved these changes
May 29, 2025
winlinvip
added a commit
that referenced
this pull request
May 29, 2025
In the scenario of converting WebRTC to RTMP, this conversion will not proceed until an SenderReport is received; for reference, see: #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: https://github.com/ossrs/srs/blob/5a404c089baa93b906d2452ef47e2ba8a9e6211c/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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the scenario of converting WebRTC to RTMP, this conversion will not proceed until an SenderReport is received; for reference, see: #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_avin 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_HttpFlvPlaytest case contains a bug:srs/trunk/3rdparty/srs-bench/srs/rtc_test.go
Lines 2421 to 2424 in 5a404c0
The test would pass when
hasAudiois true andhasVideois false, which is actually incorrect. Therefore, it has been revised so that the test now only passes if both values are true.