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

for #474, always release publish for source.

This commit is contained in:
winlin 2015-09-14 15:10:34 +08:00
parent 0d57ef9373
commit a994191ddc
4 changed files with 13 additions and 2 deletions

View file

@ -834,9 +834,13 @@ int SrsRtmpConn::publishing(SrsSource* source)
// stop isolate recv thread
trd.stop();
release_publish(source, vhost_is_edge);
}
// whatever the acquire publish, always release publish.
// when the acquire error in the midlle-way, the publish state changed,
// but failed, so we must cleanup it.
// @see https://github.com/simple-rtmp-server/srs/issues/474
release_publish(source, vhost_is_edge);
http_hooks_on_unpublish();
@ -944,10 +948,12 @@ int SrsRtmpConn::acquire_publish(SrsSource* source, bool is_edge)
if (is_edge) {
if ((ret = source->on_edge_start_publish()) != ERROR_SUCCESS) {
srs_error("notice edge start publish stream failed. ret=%d", ret);
return ret;
}
} else {
if ((ret = source->on_publish()) != ERROR_SUCCESS) {
srs_error("notify publish failed. ret=%d", ret);
return ret;
}
}