Skip to content

Commit

Permalink
Never create consumer if error.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Jul 9, 2024
1 parent 5a36003 commit 688aea5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions trunk/src/app/srs_app_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2660,13 +2660,6 @@ void SrsLiveSource::on_unpublish()
srs_error_t SrsLiveSource::create_consumer(SrsLiveConsumer*& consumer)
{
srs_error_t err = srs_success;

consumer = new SrsLiveConsumer(this);
consumers.push_back(consumer);

// There should be one consumer, so reset the timeout.
stream_die_at_ = 0;
publisher_idle_at_ = 0;

// for edge, when play edge stream, check the state
if (_srs_config->get_vhost_is_edge(req->vhost)) {
Expand All @@ -2675,6 +2668,13 @@ srs_error_t SrsLiveSource::create_consumer(SrsLiveConsumer*& consumer)
return srs_error_wrap(err, "play edge");
}
}

consumer = new SrsLiveConsumer(this);
consumers.push_back(consumer);

// There are more than one consumer, so reset the timeout.
stream_die_at_ = 0;
publisher_idle_at_ = 0;

return err;
}
Expand Down

0 comments on commit 688aea5

Please sign in to comment.