Skip to content

Commit

Permalink
Remove closed singlePC connection in ErizoClient (#1301)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcague committed Sep 20, 2018
1 parent 6dd7547 commit ca97119
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion erizo/src/erizo/MediaStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ void MediaStream::read(std::shared_ptr<DataPacket> packet) {
uint32_t recvSSRC = 0;
if (!chead->isRtcp()) {
recvSSRC = head->getSSRC();
} else if (chead->packettype == RTCP_Sender_PT) { // Sender Report
} else if (chead->packettype == RTCP_Sender_PT || chead->packettype == RTCP_SDES_PT) { // Sender Report
recvSSRC = chead->getSSRC();
}
// DELIVER FEEDBACK (RR, FEEDBACK PACKETS)
Expand Down
4 changes: 2 additions & 2 deletions erizo/src/erizo/WebRtcConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ std::shared_ptr<SdpInfo> WebRtcConnection::getLocalSdpInfo() {
return;
}
std::vector<uint32_t> video_ssrc_list = std::vector<uint32_t>();
if (media_stream->getVideoSinkSSRC() != kDefaultVideoSinkSSRC) {
if (media_stream->getVideoSinkSSRC() != kDefaultVideoSinkSSRC && media_stream->getVideoSinkSSRC() != 0) {
video_ssrc_list.push_back(media_stream->getVideoSinkSSRC());
}
ELOG_DEBUG("%s message: getting local SDPInfo, stream_id: %s, audio_ssrc: %u",
toLog(), media_stream->getId(), media_stream->getAudioSinkSSRC());
if (!video_ssrc_list.empty()) {
local_sdp_->video_ssrc_map[media_stream->getLabel()] = video_ssrc_list;
}
if (media_stream->getAudioSinkSSRC() != kDefaultAudioSinkSSRC) {
if (media_stream->getAudioSinkSSRC() != kDefaultAudioSinkSSRC && media_stream->getAudioSinkSSRC() != 0) {
local_sdp_->audio_ssrc_map[media_stream->getLabel()] = media_stream->getAudioSinkSSRC();
}
});
Expand Down
2 changes: 1 addition & 1 deletion erizo/src/erizo/thread/Worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void SimulatedWorker::close() {

std::shared_ptr<ScheduledTaskReference> SimulatedWorker::scheduleFromNow(Task f, duration delta) {
auto id = std::make_shared<ScheduledTaskReference>();
scheduled_tasks_[clock_->now() + delta] = [this, f, id] {
scheduled_tasks_[clock_->now() + delta] = [f, id] {
if (id->isCancelled()) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions erizo_controller/erizoClient/src/ErizoConnectionManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ class ErizoConnectionManager {
if (connection.streamsMap.size() === 0) {
connection.close();
if (this.ErizoConnectionsMap.get(connection.erizoId) !== undefined) {
delete this.ErizoConnectionsMap.get(connection.erizoId)['single-pc'];
delete this.ErizoConnectionsMap.get(connection.erizoId)[connection.sessionId];
}
}
Expand Down
3 changes: 2 additions & 1 deletion erizo_controller/erizoJS/erizoJSController.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ exports.ErizoJSController = function (threadPool, ioThreadPool) {
var publisher = publishers[streamId];
if (publisher !== undefined) {
log.info(`message: Removing publisher, id: ${clientId}, streamId: ${streamId}`);
for (let subscriberKey in publisher.subscribers) {
const subscriberKeys = publisher.subscribers;
for (let subscriberKey in subscriberKeys) {
let subscriber = publisher.getSubscriber(subscriberKey);
log.info('message: Removing subscriber, id: ' + subscriberKey);
closeNode(subscriber);
Expand Down

0 comments on commit ca97119

Please sign in to comment.