@@ -106,19 +106,19 @@ srs_error_t SrsBufferCache::cycle()
106
106
return err;
107
107
}
108
108
109
- SrsLiveSource* source = _srs_sources->fetch (req);
110
- if (!source ) {
109
+ SrsLiveSource* live_source = _srs_sources->fetch (req);
110
+ if (!live_source ) {
111
111
return srs_error_new (ERROR_NO_SOURCE, " no source for %s" , req->get_stream_url ().c_str ());
112
112
}
113
113
114
114
// the stream cache will create consumer to cache stream,
115
115
// which will trigger to fetch stream from origin for edge.
116
116
SrsLiveConsumer* consumer = NULL ;
117
117
SrsAutoFree (SrsLiveConsumer, consumer);
118
- if ((err = source ->create_consumer (consumer)) != srs_success) {
118
+ if ((err = live_source ->create_consumer (consumer)) != srs_success) {
119
119
return srs_error_wrap (err, " create consumer" );
120
120
}
121
- if ((err = source ->consumer_dumps (consumer, false , false , true )) != srs_success) {
121
+ if ((err = live_source ->consumer_dumps (consumer, false , false , true )) != srs_success) {
122
122
return srs_error_wrap (err, " dumps consumer" );
123
123
}
124
124
@@ -661,18 +661,18 @@ srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
661
661
// Enter chunked mode, because we didn't set the content-length.
662
662
w->write_header (SRS_CONSTS_HTTP_OK);
663
663
664
- SrsLiveSource* source = _srs_sources->fetch (req);
665
- if (!source ) {
664
+ SrsLiveSource* live_source = _srs_sources->fetch (req);
665
+ if (!live_source ) {
666
666
return srs_error_new (ERROR_NO_SOURCE, " no source for %s" , req->get_stream_url ().c_str ());
667
667
}
668
668
669
669
// create consumer of souce, ignore gop cache, use the audio gop cache.
670
670
SrsLiveConsumer* consumer = NULL ;
671
671
SrsAutoFree (SrsLiveConsumer, consumer);
672
- if ((err = source ->create_consumer (consumer)) != srs_success) {
672
+ if ((err = live_source ->create_consumer (consumer)) != srs_success) {
673
673
return srs_error_wrap (err, " create consumer" );
674
674
}
675
- if ((err = source ->consumer_dumps (consumer, true , true , !enc->has_cache ())) != srs_success) {
675
+ if ((err = live_source ->consumer_dumps (consumer, true , true , !enc->has_cache ())) != srs_success) {
676
676
return srs_error_wrap (err, " dumps consumer" );
677
677
}
678
678
@@ -694,7 +694,7 @@ srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
694
694
695
695
// if gop cache enabled for encoder, dump to consumer.
696
696
if (enc->has_cache ()) {
697
- if ((err = enc->dump_cache (consumer, source ->jitter ())) != srs_success) {
697
+ if ((err = enc->dump_cache (consumer, live_source ->jitter ())) != srs_success) {
698
698
return srs_error_wrap (err, " encoder dump cache" );
699
699
}
700
700
}
@@ -1136,16 +1136,16 @@ srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandle
1136
1136
}
1137
1137
}
1138
1138
1139
- SrsLiveSource* s = NULL ;
1140
- if ((err = _srs_sources->fetch_or_create (r, server, &s )) != srs_success) {
1139
+ SrsLiveSource* live_source = NULL ;
1140
+ if ((err = _srs_sources->fetch_or_create (r, server, &live_source )) != srs_success) {
1141
1141
return srs_error_wrap (err, " source create" );
1142
1142
}
1143
- srs_assert (s != NULL );
1143
+ srs_assert (live_source != NULL );
1144
1144
1145
1145
bool enabled_cache = _srs_config->get_gop_cache (r->vhost );
1146
1146
int gcmf = _srs_config->get_gop_cache_max_frames (r->vhost );
1147
- s ->set_cache (enabled_cache);
1148
- s ->set_gop_cache_max_frames (gcmf);
1147
+ live_source ->set_cache (enabled_cache);
1148
+ live_source ->set_gop_cache_max_frames (gcmf);
1149
1149
1150
1150
// create http streaming handler.
1151
1151
if ((err = http_mount (r)) != srs_success) {
@@ -1163,7 +1163,7 @@ srs_error_t SrsHttpStreamServer::hijack(ISrsHttpMessage* request, ISrsHttpHandle
1163
1163
// trigger edge to fetch from origin.
1164
1164
bool vhost_is_edge = _srs_config->get_vhost_is_edge (r->vhost );
1165
1165
srs_trace (" flv: source url=%s, is_edge=%d, source_id=%s/%s" ,
1166
- r->get_stream_url ().c_str (), vhost_is_edge, s ->source_id ().c_str (), s ->pre_source_id ().c_str ());
1166
+ r->get_stream_url ().c_str (), vhost_is_edge, live_source ->source_id ().c_str (), live_source ->pre_source_id ().c_str ());
1167
1167
1168
1168
return err;
1169
1169
}
0 commit comments