Skip to content

Commit

Permalink
Use shorter mids as fallbacks in 0.x (#3127)
Browse files Browse the repository at this point in the history
  • Loading branch information
lminiero committed Dec 21, 2022
1 parent 18ebf62 commit bea98a5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions ice.c
Original file line number Diff line number Diff line change
Expand Up @@ -3791,20 +3791,20 @@ int janus_ice_setup_local(janus_ice_handle *handle, int offer, int audio, int vi
if(!offer) {
if(audio) {
if(handle->audio_mid == NULL)
handle->audio_mid = g_strdup("audio");
handle->audio_mid = g_strdup("a");
if(handle->stream_mid == NULL)
handle->stream_mid = handle->audio_mid;
}
if(video) {
if(handle->video_mid == NULL)
handle->video_mid = g_strdup("video");
handle->video_mid = g_strdup("v");
if(handle->stream_mid == NULL)
handle->stream_mid = handle->video_mid;
}
#ifdef HAVE_SCTP
if(data) {
if(handle->data_mid == NULL)
handle->data_mid = g_strdup("data");
handle->data_mid = g_strdup("d");
if(handle->stream_mid == NULL)
handle->stream_mid = handle->data_mid;
}
Expand Down
6 changes: 3 additions & 3 deletions janus.c
Original file line number Diff line number Diff line change
Expand Up @@ -3732,7 +3732,7 @@ json_t *janus_plugin_handle_sdp(janus_plugin_session *plugin_session, janus_plug
}
}
if(ice_handle->audio_mid == NULL)
ice_handle->audio_mid = g_strdup("audio");
ice_handle->audio_mid = g_strdup("a");
}
if(video) {
if(!janus_flags_is_set(&ice_handle->webrtc_flags, JANUS_ICE_HANDLE_WEBRTC_HAS_VIDEO)) {
Expand All @@ -3744,11 +3744,11 @@ json_t *janus_plugin_handle_sdp(janus_plugin_session *plugin_session, janus_plug
}
}
if(ice_handle->video_mid == NULL)
ice_handle->video_mid = g_strdup("video");
ice_handle->video_mid = g_strdup("v");
}
if(data) {
if(ice_handle->data_mid == NULL)
ice_handle->data_mid = g_strdup("data");
ice_handle->data_mid = g_strdup("d");
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,14 +1366,14 @@ char *janus_sdp_merge(void *ice_handle, janus_sdp *anon, gboolean offer) {
audio++;
if(audio == 1 && m->port > 0) {
g_snprintf(buffer_part, sizeof(buffer_part),
" %s", handle->audio_mid ? handle->audio_mid : "audio");
" %s", handle->audio_mid ? handle->audio_mid : "a");
janus_strlcat(buffer, buffer_part, sizeof(buffer));
}
} else if(m->type == JANUS_SDP_VIDEO) {
video++;
if(video == 1 && m->port > 0) {
g_snprintf(buffer_part, sizeof(buffer_part),
" %s", handle->video_mid ? handle->video_mid : "video");
" %s", handle->video_mid ? handle->video_mid : "v");
janus_strlcat(buffer, buffer_part, sizeof(buffer));
}
#ifdef HAVE_SCTP
Expand All @@ -1382,7 +1382,7 @@ char *janus_sdp_merge(void *ice_handle, janus_sdp *anon, gboolean offer) {
data++;
if(data == 1 && m->port > 0) {
g_snprintf(buffer_part, sizeof(buffer_part),
" %s", handle->data_mid ? handle->data_mid : "data");
" %s", handle->data_mid ? handle->data_mid : "d");
janus_strlcat(buffer, buffer_part, sizeof(buffer));
}
#endif
Expand Down

0 comments on commit bea98a5

Please sign in to comment.