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

Refine async DVR manager.

This commit is contained in:
winlin 2022-06-29 19:51:10 +08:00
parent b4774d02cc
commit 7c6bd0ce5c
4 changed files with 8 additions and 5 deletions

View file

@ -566,8 +566,6 @@ string SrsDvrAsyncCallOnDvr::to_string()
return ss.str(); return ss.str();
} }
extern SrsAsyncCallWorker* _srs_dvr_async;
SrsDvrPlan::SrsDvrPlan() SrsDvrPlan::SrsDvrPlan()
{ {
req = NULL; req = NULL;

View file

@ -253,5 +253,7 @@ public:
virtual srs_error_t on_video(SrsSharedPtrMessage* shared_video, SrsFormat* format); virtual srs_error_t on_video(SrsSharedPtrMessage* shared_video, SrsFormat* format);
}; };
extern SrsAsyncCallWorker* _srs_dvr_async;
#endif #endif

View file

@ -11,6 +11,7 @@
#include <srs_kernel_error.hpp> #include <srs_kernel_error.hpp>
#include <srs_protocol_st.hpp> #include <srs_protocol_st.hpp>
#include <srs_app_utility.hpp> #include <srs_app_utility.hpp>
#include <srs_app_dvr.hpp>
using namespace std; using namespace std;
@ -174,6 +175,11 @@ srs_error_t SrsHybridServer::initialize()
return srs_error_wrap(err, "start timer"); return srs_error_wrap(err, "start timer");
} }
// Start the DVR async call.
if ((err = _srs_dvr_async->start()) != srs_success) {
return srs_error_wrap(err, "dvr async");
}
// Register some timers. // Register some timers.
timer20ms_->subscribe(clock_monitor_); timer20ms_->subscribe(clock_monitor_);
timer5s_->subscribe(this); timer5s_->subscribe(this);

View file

@ -421,9 +421,6 @@ srs_error_t srs_thread_initialize()
// Create global async worker for DVR. // Create global async worker for DVR.
_srs_dvr_async = new SrsAsyncCallWorker(); _srs_dvr_async = new SrsAsyncCallWorker();
if ((err = _srs_dvr_async->start()) != srs_success) {
return srs_error_wrap(err, "dvr async");
}
return err; return err;
} }