소스 검색

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());
 }
 
-bool Track::outgoing([[maybe_unused]] message_ptr message) {
+bool Track::outgoing(message_ptr message) {
 	if (mIsClosed)
 		throw std::runtime_error("Track is closed");
 
@@ -142,6 +142,10 @@ bool Track::outgoing([[maybe_unused]] message_ptr message) {
 			return false;
 	}
 
+	return transportSend(message);
+}
+
+bool Track::transportSend([[maybe_unused]] message_ptr message) {
 #if RTC_ENABLE_MEDIA
 	std::shared_ptr<DtlsSrtpTransport> transport;
 	{
@@ -171,7 +175,7 @@ void Track::setRtcpHandler(std::shared_ptr<MediaHandler> 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() {

+ 2 - 0
src/impl/track.hpp

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