mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Remove unused conn from consumer.
This commit is contained in:
parent
88826aae8f
commit
d8a158290f
4 changed files with 8 additions and 12 deletions
|
@ -129,7 +129,7 @@ srs_error_t SrsBufferCache::cycle()
|
|||
// which will trigger to fetch stream from origin for edge.
|
||||
SrsConsumer* consumer = NULL;
|
||||
SrsAutoFree(SrsConsumer, consumer);
|
||||
if ((err = source->create_consumer(NULL, consumer)) != srs_success) {
|
||||
if ((err = source->create_consumer(consumer)) != srs_success) {
|
||||
return srs_error_wrap(err, "create consumer");
|
||||
}
|
||||
if ((err = source->consumer_dumps(consumer, false, false, true)) != srs_success) {
|
||||
|
@ -587,7 +587,7 @@ srs_error_t SrsLiveStream::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMess
|
|||
// create consumer of souce, ignore gop cache, use the audio gop cache.
|
||||
SrsConsumer* consumer = NULL;
|
||||
SrsAutoFree(SrsConsumer, consumer);
|
||||
if ((err = source->create_consumer(NULL, consumer)) != srs_success) {
|
||||
if ((err = source->create_consumer(consumer)) != srs_success) {
|
||||
return srs_error_wrap(err, "create consumer");
|
||||
}
|
||||
if ((err = source->consumer_dumps(consumer, true, true, !enc->has_cache())) != srs_success) {
|
||||
|
|
|
@ -659,7 +659,7 @@ srs_error_t SrsRtmpConn::playing(SrsSource* source)
|
|||
// Create a consumer of source.
|
||||
SrsConsumer* consumer = NULL;
|
||||
SrsAutoFree(SrsConsumer, consumer);
|
||||
if ((err = source->create_consumer(this, consumer)) != srs_success) {
|
||||
if ((err = source->create_consumer(consumer)) != srs_success) {
|
||||
return srs_error_wrap(err, "rtmp: create consumer");
|
||||
}
|
||||
if ((err = source->consumer_dumps(consumer)) != srs_success) {
|
||||
|
|
|
@ -418,10 +418,9 @@ ISrsWakable::~ISrsWakable()
|
|||
{
|
||||
}
|
||||
|
||||
SrsConsumer::SrsConsumer(SrsSource* s, SrsTcpConnection* c)
|
||||
SrsConsumer::SrsConsumer(SrsSource* s)
|
||||
{
|
||||
source = s;
|
||||
conn = c;
|
||||
paused = false;
|
||||
jitter = new SrsRtmpJitter();
|
||||
queue = new SrsMessageQueue();
|
||||
|
@ -2578,11 +2577,11 @@ void SrsSource::on_unpublish()
|
|||
}
|
||||
}
|
||||
|
||||
srs_error_t SrsSource::create_consumer(SrsTcpConnection* conn, SrsConsumer*& consumer)
|
||||
srs_error_t SrsSource::create_consumer(SrsConsumer*& consumer)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
consumer = new SrsConsumer(this, conn);
|
||||
consumer = new SrsConsumer(this);
|
||||
consumers.push_back(consumer);
|
||||
|
||||
// for edge, when play edge stream, check the state
|
||||
|
|
|
@ -51,7 +51,6 @@ class SrsRtmpServer;
|
|||
class SrsEdgeProxyContext;
|
||||
class SrsMessageArray;
|
||||
class SrsNgExec;
|
||||
class SrsTcpConnection;
|
||||
class SrsMessageHeader;
|
||||
class SrsHls;
|
||||
class SrsRtc;
|
||||
|
@ -189,8 +188,6 @@ private:
|
|||
SrsRtmpJitter* jitter;
|
||||
SrsSource* source;
|
||||
SrsMessageQueue* queue;
|
||||
// The owner connection for debug, maybe NULL.
|
||||
SrsTcpConnection* conn;
|
||||
bool paused;
|
||||
// when source id changed, notice all consumers
|
||||
bool should_update_source_id;
|
||||
|
@ -203,7 +200,7 @@ private:
|
|||
srs_utime_t mw_duration;
|
||||
#endif
|
||||
public:
|
||||
SrsConsumer(SrsSource* s, SrsTcpConnection* c);
|
||||
SrsConsumer(SrsSource* s);
|
||||
virtual ~SrsConsumer();
|
||||
public:
|
||||
// Set the size of queue.
|
||||
|
@ -599,7 +596,7 @@ public:
|
|||
public:
|
||||
// Create consumer
|
||||
// @param consumer, output the create consumer.
|
||||
virtual srs_error_t create_consumer(SrsTcpConnection* conn, SrsConsumer*& consumer);
|
||||
virtual srs_error_t create_consumer(SrsConsumer*& consumer);
|
||||
// Dumps packets in cache to consumer.
|
||||
// @param ds, whether dumps the sequence header.
|
||||
// @param dm, whether dumps the metadata.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue