MT#56521 hunt for usable packet_stream

In order to rewrite certain session-level SDP lines, we need to
reference a packet_stream which contains the correct information. But we
cannot simply rely on the first media section having a usable packet
stream, as the first media section could have been rejected. Iterate
media sections until we find a usable one.

Change-Id: I36594e80981fc0645a7747399bd9951fbc2e5676
pull/1611/head
Richard Fuchs 3 years ago
parent 0b0ad562be
commit 03885f4e4d

@ -2687,15 +2687,21 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu
err = "no matching session media";
if (!m)
goto error;
call_media = m->data;
err = "mismatched session media index";
if (call_media->index != media_index)
goto error;
err = "no matching session media stream";
rtp_ps_link = call_media->streams.head;
if (!rtp_ps_link)
// look for first usable (non-rejected, non-empty) packet stream
// from any media to determine session-level attributes, if any
ps = NULL;
for (GList *mc = m; mc; mc = mc->next) {
call_media = mc->data;
if (!call_media->streams.head)
continue;
ps = call_media->streams.head->data;
break;
}
err = "no usable session media stream";
if (!ps)
goto error;
ps = rtp_ps_link->data;
err = "error while processing o= line";
if (!monologue->sdp_username)

Loading…
Cancel
Save