mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 810363 - Reject non-stereo, non-48 kHz Opus streams, r=ehugg
This commit is contained in:
parent
8559fbd229
commit
1424d481c0
@ -2855,17 +2855,24 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p,
|
||||
}
|
||||
|
||||
if (media->type == SDP_MEDIA_AUDIO) {
|
||||
ptime = sdp_attr_get_simple_u32(sdp_p->dest_sdp,
|
||||
SDP_ATTR_PTIME, level, 0, 1);
|
||||
if (ptime != 0) {
|
||||
media->packetization_period = (uint16_t) ptime;
|
||||
}
|
||||
|
||||
if (media->payload == RTP_ILBC) {
|
||||
media->mode = (uint16_t)sdp_attr_get_fmtp_mode_for_payload_type
|
||||
(sdp_p->dest_sdp, level, 0,
|
||||
media->remote_dynamic_payload_type_value);
|
||||
}
|
||||
if (media->payload == RTP_OPUS) {
|
||||
u16 a_inst;
|
||||
if (!sdp_attr_rtpmap_payload_valid(sdp_p->dest_sdp, level, 0, &a_inst,
|
||||
remote_dynamic_payload_type_value) ||
|
||||
sdp_attr_get_rtpmap_clockrate(sdp_p->dest_sdp, level, 0, a_inst) != RTPMAP_OPUS_CLOCKRATE ||
|
||||
sdp_attr_get_rtpmap_num_chan(sdp_p->dest_sdp, level, 0, a_inst) != 2) {
|
||||
/* Be conservative in what we accept: any
|
||||
implementation that does not use a 48 kHz
|
||||
clockrate or 2 channels is broken. */
|
||||
explicit_reject = TRUE;
|
||||
continue; // keep looking
|
||||
}
|
||||
|
||||
maxptime = sdp_attr_get_simple_u32(sdp_p->dest_sdp,
|
||||
SDP_ATTR_MAXPTIME, level, 0, 1);
|
||||
@ -2887,6 +2894,11 @@ gsmsdp_negotiate_codec (fsmdef_dcb_t *dcb_p, cc_sdp_t *sdp_p,
|
||||
|
||||
sdp_attr_get_fmtp_cbr (sdp_p->dest_sdp, level, 0, 1, &cbr);
|
||||
}
|
||||
ptime = sdp_attr_get_simple_u32(sdp_p->dest_sdp,
|
||||
SDP_ATTR_PTIME, level, 0, 1);
|
||||
if (ptime != 0) {
|
||||
media->packetization_period = (uint16_t) ptime;
|
||||
}
|
||||
|
||||
GSM_DEBUG(DEB_L_C_F_PREFIX"codec= %d\n",
|
||||
DEB_L_C_F_PREFIX_ARGS(GSM, dcb_p->line, dcb_p->call_id, fname),
|
||||
|
Loading…
Reference in New Issue
Block a user