Improved codecs info fix

This commit is contained in:
Juha Heinanen
2026-02-15 04:01:56 +02:00
parent 3cb05262a1
commit 0058f778cc
2 changed files with 5 additions and 10 deletions

View File

@ -1457,9 +1457,9 @@ JNIEXPORT jstring JNICALL Java_com_tutpro_baresip_Api_call_1audio_1codecs(
if (tx && rx) if (tx && rx)
len = re_snprintf(start, left, "%s/%u/%u,%s/%u/%u", tx->name, tx->srate, tx->ch, rx->name, len = re_snprintf(start, left, "%s/%u/%u,%s/%u/%u", tx->name, tx->srate, tx->ch, rx->name,
rx->srate, rx->ch); rx->srate, rx->ch);
if (len == -1) { else {
LOGE("failed to get audio codecs of call %ld\n", (long)call); 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); return (*env)->NewStringUTF(env, codec_buf);
} }

View File

@ -1892,15 +1892,10 @@ private fun CallRow(
parts[3] = "?/?" parts[3] = "?/?"
parts[4] = "?/?" parts[4] = "?/?"
} }
val codecs = call.audioCodecs() val codecs = call.audioCodecs().split(',')
val duration = call.duration() val duration = call.duration()
val codecParts = codecs.split(',') val txCodec = codecs[0].split("/")
var txCodec = listOf("?", "?", "?") val rxCodec = codecs[1].split("/")
var rxCodec = listOf("?", "?", "?")
if (codecParts.size == 2) {
txCodec = codecParts[0].split("/")
rxCodec = codecParts[1].split("/")
}
alertTitle.value = ctx.getString(R.string.call_info) alertTitle.value = ctx.getString(R.string.call_info)
alertMessage.value = alertMessage.value =
"${String.format(ctx.getString(R.string.duration), duration)}\n" + "${String.format(ctx.getString(R.string.duration), duration)}\n" +