srs icon indicating copy to clipboard operation
srs copied to clipboard

Fix Stream statistics bug

Open mapengfei53 opened this issue 3 years ago • 2 comments

Summary

Fix Stream statistics bug

Details

Error number of clients is displayed after the stream is pushed again。#2903

mapengfei53 avatar Feb 16 '22 05:02 mapengfei53

Codecov Report

Merging #2921 (65c3f34) into 4.0release (cd0599b) will decrease coverage by 0.00%. The diff coverage is 0.00%.

:exclamation: Current head 65c3f34 differs from pull request most recent head 579d90b. Consider uploading reports for the commit 579d90b to get more accurate results

Impacted file tree graph

@@              Coverage Diff               @@
##           4.0release    #2921      +/-   ##
==============================================
- Coverage       60.22%   60.22%   -0.01%     
==============================================
  Files             121      121              
  Lines           51096    51097       +1     
==============================================
  Hits            30772    30772              
- Misses          20324    20325       +1     

| Impacted Files | Coverage Δ | |'

Translated to English while maintaining the markdown structure:

'| Impacted Files | Coverage Δ | | |---|---|---| | trunk/src/app/srs_app_statistic.cpp | 27.46% <0.00%> (-0.09%) | :arrow_down: |


Continue to review full report at Codecov.

Legend - Click here to learn more Translated to English while maintaining the markdown structure:

'> Δ = absolute <relative> (impact), ø = not affected, ? = missing data

Powered by Codecov. Last update cd0599b...579d90b. Read the comment docs.

TRANS_BY_GPT3

codecov-commenter avatar Feb 16 '22 05:02 codecov-commenter

The main reason for this issue is that when the streaming is disconnected, all the statistical information of this stream is cleared (previously, there was an issue in the code, but currently, the issue cannot be accessed, so it is unclear what problem this code segment is addressing). The current modification is to only clear the statistical information when the number of streams is 0. Previously, the code cleared the stream information but lacked the stream's free, which I believe also leads to a memory leak issue.

TRANS_BY_GPT3

mapengfei53 avatar Feb 17 '22 01:02 mapengfei53

Fixed by https://github.com/ossrs/srs/commit/e9d6601f7d069c6762df7a107c56abefa69626f4

winlinvip avatar Sep 01 '22 12:09 winlinvip