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

for #374, use fast stop for ingesters to stop many FFMPEG.

This commit is contained in:
winlin 2015-05-30 11:25:33 +08:00
parent d611bb6b45
commit 860d68e6e7
6 changed files with 76 additions and 7 deletions

View file

@ -51,6 +51,11 @@ SrsIngesterFFMPEG::~SrsIngesterFFMPEG()
srs_freep(ffmpeg);
}
void SrsIngesterFFMPEG::fast_stop()
{
ffmpeg->fast_stop();
}
SrsIngester::SrsIngester()
{
_srs_config->subscribe(this);
@ -161,6 +166,18 @@ int SrsIngester::parse_engines(SrsConfDirective* vhost, SrsConfDirective* ingest
void SrsIngester::dispose()
{
// first, use fast stop to notice all FFMPEG to quit gracefully.
std::vector<SrsIngesterFFMPEG*>::iterator it;
for (it = ingesters.begin(); it != ingesters.end(); ++it) {
SrsIngesterFFMPEG* ingester = *it;
ingester->fast_stop();
}
if (!ingesters.empty()) {
srs_trace("fast stop all ingesters ok.");
}
// then, use stop to wait FFMPEG quit one by one and send SIGKILL if needed.
stop();
}