From 19c53236331bdf0aab3a8fdfb12f457f571173ac Mon Sep 17 00:00:00 2001 From: xia-chu <771730766@qq.com> Date: Fri, 28 Apr 2023 23:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DstartSendRtp=E5=8F=91?= =?UTF-8?q?=E9=80=81mp4=E6=96=87=E4=BB=B6=E6=97=B6=E5=B4=A9=E6=BA=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=9A#2429?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/MultiMediaSourceMuxer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Common/MultiMediaSourceMuxer.cpp b/src/Common/MultiMediaSourceMuxer.cpp index 9c6f7a8a..daa68769 100644 --- a/src/Common/MultiMediaSourceMuxer.cpp +++ b/src/Common/MultiMediaSourceMuxer.cpp @@ -248,10 +248,11 @@ void MultiMediaSourceMuxer::startSendRtp(MediaSource &sender, const MediaSourceE auto ring = _ring; auto ssrc = args.ssrc; auto tracks = getTracks(false); - auto rtp_sender = std::make_shared(getOwnerPoller(sender)); + auto poller = getOwnerPoller(sender); + auto rtp_sender = std::make_shared(poller); weak_ptr weak_self = shared_from_this(); - rtp_sender->startSend(args, [ssrc, weak_self, rtp_sender, cb, tracks, ring](uint16_t local_port, const SockException &ex) mutable { + rtp_sender->startSend(args, [ssrc, weak_self, rtp_sender, cb, tracks, ring, poller](uint16_t local_port, const SockException &ex) mutable { cb(local_port, ex); auto strong_self = weak_self.lock(); if (!strong_self || ex) { @@ -273,7 +274,7 @@ void MultiMediaSourceMuxer::startSendRtp(MediaSource &sender, const MediaSourceE } }); - auto reader = ring->attach(EventPoller::getCurrentPoller()); + auto reader = ring->attach(poller); reader->setReadCB([rtp_sender](const Frame::Ptr &frame) { rtp_sender->inputFrame(frame); }); @@ -315,7 +316,7 @@ EventPoller::Ptr MultiMediaSourceMuxer::getOwnerPoller(MediaSource &sender) { try { auto ret = listener->getOwnerPoller(sender); if (ret != _poller) { - WarnL << "OwnerPoller changed:" << shortUrl(); + WarnL << "OwnerPoller changed " << _poller->getThreadName() << " -> " << ret->getThreadName() << " : " << shortUrl(); _poller = ret; } return ret;