فهرست منبع

Fixed deadlock in MediaChainableHandler (regression introduced in #347)

Paul-Louis Ageneau 4 سال پیش
والد
کامیت
9f6e99c0a8
2فایلهای تغییر یافته به همراه8 افزوده شده و 2 حذف شده
  1. 6 2
      src/impl/track.cpp
  2. 2 0
      src/impl/track.hpp

+ 6 - 2
src/impl/track.cpp

@@ -126,7 +126,7 @@ void Track::incoming(message_ptr message) {
 	triggerAvailable(mRecvQueue.size());
 	triggerAvailable(mRecvQueue.size());
 }
 }
 
 
-bool Track::outgoing([[maybe_unused]] message_ptr message) {
+bool Track::outgoing(message_ptr message) {
 	if (mIsClosed)
 	if (mIsClosed)
 		throw std::runtime_error("Track is closed");
 		throw std::runtime_error("Track is closed");
 
 
@@ -142,6 +142,10 @@ bool Track::outgoing([[maybe_unused]] message_ptr message) {
 			return false;
 			return false;
 	}
 	}
 
 
+	return transportSend(message);
+}
+
+bool Track::transportSend([[maybe_unused]] message_ptr message) {
 #if RTC_ENABLE_MEDIA
 #if RTC_ENABLE_MEDIA
 	std::shared_ptr<DtlsSrtpTransport> transport;
 	std::shared_ptr<DtlsSrtpTransport> transport;
 	{
 	{
@@ -171,7 +175,7 @@ void Track::setRtcpHandler(std::shared_ptr<MediaHandler> handler) {
 		mRtcpHandler = handler;
 		mRtcpHandler = handler;
 	}
 	}
 
 
-	handler->onOutgoing(std::bind(&Track::outgoing, this, std::placeholders::_1));
+	handler->onOutgoing(std::bind(&Track::transportSend, this, std::placeholders::_1));
 }
 }
 
 
 std::shared_ptr<MediaHandler> Track::getRtcpHandler() {
 std::shared_ptr<MediaHandler> Track::getRtcpHandler() {

+ 2 - 0
src/impl/track.hpp

@@ -64,6 +64,8 @@ public:
 #endif
 #endif
 
 
 private:
 private:
+	bool transportSend(message_ptr message);
+
 #if RTC_ENABLE_MEDIA
 #if RTC_ENABLE_MEDIA
 	weak_ptr<DtlsSrtpTransport> mDtlsSrtpTransport;
 	weak_ptr<DtlsSrtpTransport> mDtlsSrtpTransport;
 #endif
 #endif