Commit e20c2ed9 authored by Simon Morlat's avatar Simon Morlat

Ticker synchronizer must be destroyed after the record has been stopped,...

Ticker synchronizer must be destroyed after the record has been stopped, otherwise we risk an invalid write within the recorder's callback.
parent 0f9174f3
......@@ -486,8 +486,6 @@ static void sound_read_postprocess(MSFilter *f){
JNIEnv *jni_env = ms_get_jni_env();
ms_ticker_set_synchronizer(f->ticker, NULL);
ms_ticker_synchronizer_destroy(d->ticker_synchronizer);
d->read_samples=0;
//stop recording
stop_id = jni_env->GetMethodID(d->audio_record_class,"stop", "()V");
......@@ -519,6 +517,11 @@ static void sound_read_postprocess(MSFilter *f){
}
goto end;
end: {
if (d->ticker_synchronizer) {
ms_ticker_synchronizer_destroy(d->ticker_synchronizer);
d->ticker_synchronizer = NULL;
}
d->read_samples=0;
if (d->audio_record) jni_env->DeleteGlobalRef(d->audio_record);
jni_env->DeleteGlobalRef(d->audio_record_class);
if (d->read_buff) jni_env->DeleteGlobalRef(d->read_buff);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment