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

Live: Limit cached max frames by gop_cache_max_frames (#3236)

* add gop_cache_max_frames

* Live: Limit cached max frames by gop_cache_max_frames. v5.0.93

Co-authored-by: wanglei <wanglei@unicloud.com>
Co-authored-by: winlin <winlin@vip.126.com>
This commit is contained in:
stone 2022-11-22 12:31:45 +08:00 committed by GitHub
parent 4ada0bc629
commit ec76512e42
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 75 additions and 7 deletions

View file

@ -557,9 +557,12 @@ srs_error_t SrsRtmpConn::stream_service_cycle()
srs_assert(source != NULL);
bool enabled_cache = _srs_config->get_gop_cache(req->vhost);
srs_trace("source url=%s, ip=%s, cache=%d, is_edge=%d, source_id=%s/%s",
req->get_stream_url().c_str(), ip.c_str(), enabled_cache, info->edge, source->source_id().c_str(), source->pre_source_id().c_str());
int gcmf = _srs_config->get_gop_cache_max_frames(req->vhost);
srs_trace("source url=%s, ip=%s, cache=%d/%d, is_edge=%d, source_id=%s/%s",
req->get_stream_url().c_str(), ip.c_str(), enabled_cache, gcmf, info->edge, source->source_id().c_str(),
source->pre_source_id().c_str());
source->set_cache(enabled_cache);
source->set_gop_cache_max_frames(gcmf);
switch (info->type) {
case SrsRtmpConnPlay: {