Skip to content

Commit

Permalink
Fix rtcp_feedback for audio not written into flat buffers (#1401)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstyura authored May 17, 2024
1 parent 7207df7 commit 84a39ff
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions rust/src/rtp_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -943,21 +943,19 @@ impl RtpParameters {
})
.collect(),
),
rtcp_feedback: match &codec {
RtpCodecParameters::Audio { .. } => None,
RtpCodecParameters::Video { rtcp_feedback, .. } => Some(
rtcp_feedback
.iter()
.map(|rtcp_feedback| {
let (r#type, parameter) = rtcp_feedback.as_type_parameter();
rtp_parameters::RtcpFeedback {
type_: r#type.to_string(),
parameter: Some(parameter.to_string()),
}
})
.collect(),
),
},
rtcp_feedback: Some(
codec
.rtcp_feedback()
.iter()
.map(|rtcp_feedback| {
let (r#type, parameter) = rtcp_feedback.as_type_parameter();
rtp_parameters::RtcpFeedback {
type_: r#type.to_string(),
parameter: Some(parameter.to_string()),
}
})
.collect(),
),
})
.collect(),
header_extensions: self
Expand Down Expand Up @@ -1118,6 +1116,11 @@ impl RtpCodecParameters {
parameters
}

pub(crate) fn rtcp_feedback(&self) -> &[RtcpFeedback] {
let (Self::Audio { rtcp_feedback, .. } | Self::Video { rtcp_feedback, .. }) = self;
rtcp_feedback
}

pub(crate) fn rtcp_feedback_mut(&mut self) -> &mut Vec<RtcpFeedback> {
let (Self::Audio { rtcp_feedback, .. } | Self::Video { rtcp_feedback, .. }) = self;
rtcp_feedback
Expand Down

0 comments on commit 84a39ff

Please sign in to comment.