Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using publisher from OTM #1556

Merged
merged 3 commits into from
Mar 19, 2020

Conversation

jcague
Copy link
Contributor

@jcague jcague commented Mar 17, 2020

Description

There have been other crashes inside OneToManyProcessor when trying to access publisher's stuff.

[] It needs and includes Unit Tests

Changes in Client or Server public APIs

Not needed.

[] It includes documentation for these changes in /doc.

Copy link
Contributor

@lodoyun lodoyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

@@ -69,13 +70,14 @@ namespace erizo {
return 0;
}
boost::unique_lock<boost::mutex> lock(monitor_mutex_);
if (subscribers.empty())
if (subscribers_.empty() || !publisher_) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

int deliverAudioData_(std::shared_ptr<DataPacket> audio_packet) override;
int deliverVideoData_(std::shared_ptr<DataPacket> video_packet) override;
int deliverFeedback_(std::shared_ptr<DataPacket> fb_packet) override;
int deliverEvent_(MediaEventPtr event) override;
boost::future<void> closeAll();
bool isSSRCFromAudio(uint32_t ssrc);
uint32_t translateAndMaybeAdaptForSimulcast(uint32_t orig_ssrc);

private:
typedef std::shared_ptr<MediaSink> sink_ptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 to the variable names updates. In that line, shouldn't this be sink_ptr_ ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we can remove it because we don't use it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was a typedef instead, but we don't use to define any variable in this class

@@ -165,7 +165,7 @@ NAN_METHOD(OneToManyProcessor::getPublisherState) {
return;
}

auto wr = std::dynamic_pointer_cast<erizo::MediaStream>(me->publisher);
auto wr = std::dynamic_pointer_cast<erizo::MediaStream>(me->getPublisher());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jcague jcague merged commit 2f2ec34 into lynckia:master Mar 19, 2020
@jcague jcague deleted the fix/wrong_access_to_publisher_from_otm branch March 19, 2020 13:02
Arri98 pushed a commit to Arri98/licode that referenced this pull request Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants