mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
fix the bug: when trying to push same stream more than twice, to play it through http-flv will cause a core dump(#666)
This commit is contained in:
parent
d6fc289c6a
commit
4f09bcce9f
2 changed files with 26 additions and 0 deletions
24
trunk/src/app/srs_app_http_stream.cpp
Normal file → Executable file
24
trunk/src/app/srs_app_http_stream.cpp
Normal file → Executable file
|
@ -78,6 +78,17 @@ SrsStreamCache::~SrsStreamCache()
|
|||
srs_freep(req);
|
||||
}
|
||||
|
||||
int SrsStreamCache::update(SrsSource* s, SrsRequest* r)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
srs_freep(req);
|
||||
req = r->copy();
|
||||
source = s;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsStreamCache::start()
|
||||
{
|
||||
return pthread->start();
|
||||
|
@ -451,6 +462,17 @@ SrsLiveStream::~SrsLiveStream()
|
|||
srs_freep(req);
|
||||
}
|
||||
|
||||
int SrsLiveStream::update(SrsSource* s, SrsRequest* r)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
||||
srs_freep(req);
|
||||
source = s;
|
||||
req = r->copy();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
|
||||
{
|
||||
int ret = ERROR_SUCCESS;
|
||||
|
@ -836,6 +858,8 @@ int SrsHttpStreamServer::http_mount(SrsSource* s, SrsRequest* r)
|
|||
srs_trace("http: mount flv stream for vhost=%s, mount=%s", sid.c_str(), mount.c_str());
|
||||
} else {
|
||||
entry = sflvs[sid];
|
||||
entry->stream->update(s, r);
|
||||
entry->cache->update(s, r);
|
||||
}
|
||||
|
||||
if (entry->stream) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue