Skip to content

Commit

Permalink
Merge pull request #915 from mondain/feedback
Browse files Browse the repository at this point in the history
Add type check on track to prevent PLI for non-video tracks.
  • Loading branch information
paullouisageneau authored Jun 25, 2023
2 parents fdb2f64 + 72719f2 commit e420698
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/rtc/rtcpnackresponder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class RTC_CPP_EXPORT RtcpNackResponder final : public MediaHandlerElement {
/// Maximum storage size
const unsigned maximumSize;

/// Returnst current size
/// Returns current size
unsigned size();

public:
Expand Down
2 changes: 1 addition & 1 deletion src/rtcpreceivingsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool RtcpReceivingSession::send(message_ptr msg) {

bool RtcpReceivingSession::requestKeyframe() {
pushPLI();
return true; // TODO Make this false when it is impossible (i.e. Opus).
return true;
}

void RtcpReceivingSession::pushPLI() {
Expand Down
9 changes: 6 additions & 3 deletions src/track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ void Track::setMediaHandler(shared_ptr<MediaHandler> handler) {
}

bool Track::requestKeyframe() {
if (auto handler = impl()->getMediaHandler())
return handler->requestKeyframe();

// only push PLI for video
if (description().type() == "video") {
if (auto handler = impl()->getMediaHandler()) {
return handler->requestKeyframe();
}
}
return false;
}

Expand Down

0 comments on commit e420698

Please sign in to comment.