diff --git a/app/src/main/cpp/baresip.c b/app/src/main/cpp/baresip.c index 9ce8339e..ccb915d3 100644 --- a/app/src/main/cpp/baresip.c +++ b/app/src/main/cpp/baresip.c @@ -1457,9 +1457,9 @@ JNIEXPORT jstring JNICALL Java_com_tutpro_baresip_Api_call_1audio_1codecs( if (tx && rx) len = re_snprintf(start, left, "%s/%u/%u,%s/%u/%u", tx->name, tx->srate, tx->ch, rx->name, rx->srate, rx->ch); - if (len == -1) { + else { LOGE("failed to get audio codecs of call %ld\n", (long)call); - codec_buf[0] = '\0'; + len = re_snprintf(start, left, "%s/%u/%u,%s/%u/%u", '?', 0, 0, '?', 0, 0); } return (*env)->NewStringUTF(env, codec_buf); } diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt index f69eda33..d0d2de3f 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt @@ -1892,15 +1892,10 @@ private fun CallRow( parts[3] = "?/?" parts[4] = "?/?" } - val codecs = call.audioCodecs() + val codecs = call.audioCodecs().split(',') val duration = call.duration() - val codecParts = codecs.split(',') - var txCodec = listOf("?", "?", "?") - var rxCodec = listOf("?", "?", "?") - if (codecParts.size == 2) { - txCodec = codecParts[0].split("/") - rxCodec = codecParts[1].split("/") - } + val txCodec = codecs[0].split("/") + val rxCodec = codecs[1].split("/") alertTitle.value = ctx.getString(R.string.call_info) alertMessage.value = "${String.format(ctx.getString(R.string.duration), duration)}\n" +