diff --git a/app/build.gradle b/app/build.gradle index 682a6a26..38f7fd18 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId = 'com.tutpro.baresip' minSdkVersion 21 targetSdkVersion 27 - versionCode = 27 - versionName = '3.1.0' + versionCode = 28 + versionName = '3.1.1' externalNativeBuild { cmake { cFlags '-DHAVE_INTTYPES_H' diff --git a/app/src/main/cpp/baresip.c b/app/src/main/cpp/baresip.c index 9f845e54..0da4d3bd 100644 --- a/app/src/main/cpp/baresip.c +++ b/app/src/main/cpp/baresip.c @@ -951,7 +951,8 @@ Java_com_tutpro_baresip_MainActivity_call_1start_1audio(JNIEnv *env, jobject thi struct call *call = (struct call *)strtoul(native_call, NULL, 10); LOGD("starting audio of call %s\n", native_call); re_thread_enter(); - audio_start(call_audio(call)); + struct audio *a = call_audio(call); + if (!audio_started(a)) audio_start(a); re_thread_leave(); (*env)->ReleaseStringUTFChars(env, javaCall, native_call); return; @@ -963,7 +964,8 @@ Java_com_tutpro_baresip_MainActivity_call_1stop_1audio(JNIEnv *env, jobject thiz struct call *call = (struct call *)strtoul(native_call, NULL, 10); LOGD("stopping audio of call %s\n", native_call); re_thread_enter(); - audio_stop(call_audio(call)); + struct audio *a = call_audio(call); + if (audio_started(a)) audio_stop(a); re_thread_leave(); (*env)->ReleaseStringUTFChars(env, javaCall, native_call); return;