Browse Source

MT#55283 fix generic codec matching

Only parse out a codec type if the codec is given with any parameters
set (and not just by name). Parsing out a codec type when just its name
is given leads to a codec type with default parameters set (such as the
number of channels) which can lead to a stricter matching than desired.
When a codec is given just by name we want to match all codecs of that
type, not just the ones with the same parameters as the default ones.

Change-Id: I583bf4045dbd55291d8dc596310730024853d386
pull/1614/head
Richard Fuchs 3 years ago
parent
commit
4b3108da18
2 changed files with 9 additions and 6 deletions
  1. +6
    -3
      daemon/codec.c
  2. +3
    -3
      t/auto-daemon-tests.pl

+ 6
- 3
daemon/codec.c View File

@ -4360,12 +4360,15 @@ static void codec_store_find_matching_codecs(GQueue *out_compat, struct rtp_payl
struct rtp_payload_type *pt_parsed)
{
AUTO_CLEANUP_NULL(struct rtp_payload_type *pt_store, payload_type_destroy);
struct rtp_payload_type *pt;
struct rtp_payload_type *pt = NULL;
if (pt_parsed)
pt = pt_parsed;
else
pt = pt_store = codec_make_payload_type_sup(codec, cs->media);
else {
// parse out the codec params if any are given, otherwise just go with the name
if (str_chr(codec, '/'))
pt = pt_store = codec_make_payload_type_sup(codec, cs->media);
}
GQueue *pts = g_hash_table_lookup(cs->codec_names, codec);
if (pt) {


+ 3
- 3
t/auto-daemon-tests.pl View File

@ -534,13 +534,13 @@ v=0
o=- 1545997027 1 IN IP4 198.51.100.4
s=tester
t=0 0
m=audio PORT RTP/AVP 8
m=audio PORT RTP/AVP 96
c=IN IP4 203.0.113.1
a=rtpmap:8 PCMA/8000
a=rtpmap:96 AMR-WB/16000
a=fmtp:96 mode-set=3,4,5
a=sendrecv
a=rtcp:PORT
SDP
# ^ XXX maybe change this to allow for octet-align=any if not given?


Loading…
Cancel
Save