winlin

for #474, always release publish for source.

... ... @@ -343,6 +343,7 @@ Remark:
## History
* v2.0, 2015-09-14, for [#474][bug #474] always release publish for source.
* v2.0, 2015-09-14, for [#458][bug #458] http hooks use source thread cid. 2.0.188
* v2.0, 2015-09-14, for [#475][bug #475] fix http hooks crash for st context switch. 2.0.187
* v2.0, 2015-09-09, support reload utc_time. 2.0.186
... ... @@ -1026,6 +1027,7 @@ Winlin
[bug #133]: https://github.com/simple-rtmp-server/srs/issues/133
[bug #92]: https://github.com/simple-rtmp-server/srs/issues/92
[bug #380]: https://github.com/simple-rtmp-server/srs/issues/380
[bug #474]: https://github.com/simple-rtmp-server/srs/issues/474
[bug #475]: https://github.com/simple-rtmp-server/srs/issues/475
[bug #458]: https://github.com/simple-rtmp-server/srs/issues/458
[bug #454]: https://github.com/simple-rtmp-server/srs/issues/454
... ...
... ... @@ -834,9 +834,13 @@ int SrsRtmpConn::publishing(SrsSource* source)
// stop isolate recv thread
trd.stop();
}
// 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;
}
}
... ...
... ... @@ -2066,6 +2066,7 @@ int SrsSource::on_publish()
}
SrsStatistic* stat = SrsStatistic::instance();
stat->on_stream_publish(_req, _source_id);
return ret;
}
... ...
... ... @@ -217,6 +217,8 @@ namespace internal {
handler->on_thread_stop();
srs_info("thread %s cycle finished", _name);
// TODO: FIXME: when thread terminated normally, set the tid to NULL.
}
void* SrsThread::thread_fun(void* arg)
... ...