Skip to content

Commit

Permalink
Fix #3093: WebRTC: Error when SDP not matched.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Sep 9, 2022
1 parent 1c0236a commit 8ac8ae1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions trunk/src/app/srs_app_rtc_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3035,6 +3035,11 @@ srs_error_t SrsRtcConnection::negotiate_publish_capability(SrsRtcUserConfig* ruc
//local_media_desc.payload_types_.back().rtcp_fb_.push_back("rrtr");
}

// Error if track desc is invalid, that is failed to match SDP, for example, we require H264 but no H264 found.
if (track_desc->type_.empty() || !track_desc->media_) {
return srs_error_new(ERROR_RTC_SDP_EXCHANGE, "no match for track=%s, mid=%s, tracker=%s", remote_media_desc.type_.c_str(), remote_media_desc.mid_.c_str(), remote_media_desc.msid_tracker_.c_str());
}

// TODO: FIXME: use one parse payload from sdp.

track_desc->create_auxiliary_payload(remote_media_desc.find_media_with_encoding_name("red"));
Expand Down

0 comments on commit 8ac8ae1

Please sign in to comment.