正在显示
2 个修改的文件
包含
8 行增加
和
0 行删除
@@ -63,6 +63,12 @@ SrsSource::SrsSource(std::string _stream_url) | @@ -63,6 +63,12 @@ SrsSource::SrsSource(std::string _stream_url) | ||
63 | 63 | ||
64 | SrsSource::~SrsSource() | 64 | SrsSource::~SrsSource() |
65 | { | 65 | { |
66 | + std::vector<SrsConsumer*>::iterator it; | ||
67 | + for (it = consumers.begin(); it != consumers.end(); ++it) { | ||
68 | + SrsConsumer* consumer = *it; | ||
69 | + srs_freep(consumer); | ||
70 | + } | ||
71 | + consumers.clear(); | ||
66 | } | 72 | } |
67 | 73 | ||
68 | int SrsSource::on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata) | 74 | int SrsSource::on_meta_data(SrsCommonMessage* msg, SrsOnMetaDataPacket* metadata) |
@@ -90,6 +96,7 @@ int SrsSource::on_video(SrsCommonMessage* audio) | @@ -90,6 +96,7 @@ int SrsSource::on_video(SrsCommonMessage* audio) | ||
90 | SrsConsumer* SrsSource::create_consumer() | 96 | SrsConsumer* SrsSource::create_consumer() |
91 | { | 97 | { |
92 | SrsConsumer* consumer = new SrsConsumer(); | 98 | SrsConsumer* consumer = new SrsConsumer(); |
99 | + consumers.push_back(consumer); | ||
93 | return consumer; | 100 | return consumer; |
94 | } | 101 | } |
95 | 102 |
@@ -71,6 +71,7 @@ public: | @@ -71,6 +71,7 @@ public: | ||
71 | static SrsSource* find(std::string stream_url); | 71 | static SrsSource* find(std::string stream_url); |
72 | private: | 72 | private: |
73 | std::string stream_url; | 73 | std::string stream_url; |
74 | + std::vector<SrsConsumer*> consumers; | ||
74 | public: | 75 | public: |
75 | SrsSource(std::string _stream_url); | 76 | SrsSource(std::string _stream_url); |
76 | virtual ~SrsSource(); | 77 | virtual ~SrsSource(); |
-
请 注册 或 登录 后发表评论