Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiveSource: Refine fetch for external exposed interface. #2873

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions trunk/src/app/srs_app_rtc_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ srs_error_t SrsRtcSourceManager::fetch_or_create(SrsRequest* r, SrsRtcSource** p

SrsRtcSource* source = NULL;
if ((source = fetch(r)) != NULL) {
// we always update the request of resource,
// for origin auth is on, the token in request maybe invalid,
// and we only need to update the token of request, it's simple.
source->update_auth(r);
*pps = source;
return err;
}
Expand Down Expand Up @@ -291,11 +295,6 @@ SrsRtcSource* SrsRtcSourceManager::fetch(SrsRequest* r)

source = pool[stream_url];

// we always update the request of resource,
// for origin auth is on, the token in request maybe invalid,
// and we only need to update the token of request, it's simple.
source->update_auth(r);

return source;
}

Expand Down
1 change: 0 additions & 1 deletion trunk/src/app/srs_app_rtc_source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ class SrsRtcSourceManager
virtual srs_error_t fetch_or_create(SrsRequest* r, SrsRtcSource** pps);
private:
// Get the exists source, NULL when not exists.
// update the request and return the exists source.
virtual SrsRtcSource* fetch(SrsRequest* r);
};

Expand Down
9 changes: 4 additions & 5 deletions trunk/src/app/srs_app_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,10 @@ srs_error_t SrsLiveSourceManager::fetch_or_create(SrsRequest* r, ISrsLiveSourceH

SrsLiveSource* source = NULL;
if ((source = fetch(r)) != NULL) {
// we always update the request of resource,
// for origin auth is on, the token in request maybe invalid,
// and we only need to update the token of request, it's simple.
source->update_auth(r);
*pps = source;
return err;
}
Expand Down Expand Up @@ -1751,11 +1755,6 @@ SrsLiveSource* SrsLiveSourceManager::fetch(SrsRequest* r)

source = pool[stream_url];

// we always update the request of resource,
// for origin auth is on, the token in request maybe invalid,
// and we only need to update the token of request, it's simple.
source->update_auth(r);

return source;
}

Expand Down
1 change: 0 additions & 1 deletion trunk/src/app/srs_app_source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ class SrsLiveSourceManager : public ISrsHourGlass
virtual srs_error_t fetch_or_create(SrsRequest* r, ISrsLiveSourceHandler* h, SrsLiveSource** pps);
public:
// Get the exists source, NULL when not exists.
// update the request and return the exists source.
virtual SrsLiveSource* fetch(SrsRequest* r);
public:
// dispose and cycle all sources.
Expand Down