1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Live: Fix bug for gop cache limits. v5.0.99 (#3289)

* bugfix: setting srt bridge to rtmp gop cache limit while SrsMpegtsSrtConn::acquire_publish 

* setting http_stream gop cache limit while SrsHttpStreamServer::hijack

* if gop_cache_max_frames_ == 0, don't enable the got cache max frames limit

Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
stone 2022-12-01 22:07:11 +08:00 committed by GitHub
parent e83fc2388b
commit a4d9e45545
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 2 deletions

View file

@ -659,7 +659,7 @@ srs_error_t SrsGopCache::cache(SrsSharedPtrMessage* shared_msg)
gop_cache.push_back(msg->copy());
// Clear gop cache if exceed the max frames.
if (gop_cache.size() > (size_t)gop_cache_max_frames_) {
if (gop_cache_max_frames_ > 0 && gop_cache.size() > (size_t)gop_cache_max_frames_) {
srs_warn("Gop cache exceed max frames=%d, total=%d, videos=%d, aalvc=%d",
gop_cache_max_frames_, (int)gop_cache.size(), cached_video_count, audio_after_last_video_count);
clear();