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

For #906, #902, remove the thread start and stop event

This commit is contained in:
winlin 2017-05-29 18:42:36 +08:00
parent 3ffb0980f5
commit b21f92f97a
12 changed files with 62 additions and 67 deletions

View file

@ -92,6 +92,21 @@ void SrsEncoder::on_unpublish()
}
int SrsEncoder::cycle()
{
int ret = do_cycle();
// kill ffmpeg when finished and it alive
std::vector<SrsFFMPEG*>::iterator it;
for (it = ffmpegs.begin(); it != ffmpegs.end(); ++it) {
SrsFFMPEG* ffmpeg = *it;
ffmpeg->stop();
}
return ret;
}
int SrsEncoder::do_cycle()
{
int ret = ERROR_SUCCESS;
@ -118,17 +133,6 @@ int SrsEncoder::cycle()
return ret;
}
void SrsEncoder::on_thread_stop()
{
// kill ffmpeg when finished and it alive
std::vector<SrsFFMPEG*>::iterator it;
for (it = ffmpegs.begin(); it != ffmpegs.end(); ++it) {
SrsFFMPEG* ffmpeg = *it;
ffmpeg->stop();
}
}
void SrsEncoder::clear_engines()
{
std::vector<SrsFFMPEG*>::iterator it;