[Android] libvlc: rework DynamicsProcessing stop

Thomas Guillem git at videolan.org
Tue Aug 10 12:41:32 UTC 2021


vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Aug 10 11:28:44 2021 +0200| [a97a6944b35d79357ef3556837f1ea0a5f89f9ee] | committer: Nicolas Pomepuy

libvlc: rework DynamicsProcessing stop

This commit tries to fix a very rare crash with DP.

> https://code.videolan.org/videolan/vlc-android/commit/a97a6944b35d79357ef3556837f1ea0a5f89f9ee
---

 ...audiotrack-rework-DynamicsProcessing-stop.patch | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/libvlc/patches/vlc3/0013-audiotrack-rework-DynamicsProcessing-stop.patch b/libvlc/patches/vlc3/0013-audiotrack-rework-DynamicsProcessing-stop.patch
new file mode 100644
index 000000000..4f2e4f65f
--- /dev/null
+++ b/libvlc/patches/vlc3/0013-audiotrack-rework-DynamicsProcessing-stop.patch
@@ -0,0 +1,52 @@
+From b0d5fa154e0fc27f6d368977886348269a527aa8 Mon Sep 17 00:00:00 2001
+Message-Id: <b0d5fa154e0fc27f6d368977886348269a527aa8.1628587500.git.thomas at gllm.fr>
+In-Reply-To: <725e37106e83190ea20042aa9dc01c1c7646b37d.1628587500.git.thomas at gllm.fr>
+References: <725e37106e83190ea20042aa9dc01c1c7646b37d.1628587500.git.thomas at gllm.fr>
+From: Thomas Guillem <thomas at gllm.fr>
+Date: Tue, 10 Aug 2021 11:06:25 +0200
+Subject: [PATCH 13/13] audiotrack: rework DynamicsProcessing stop
+
+Specifically disable it before unreferencing the jobject and destroy it
+before AudioTrack.
+
+This commit tries to fix a very rare crash with DP.
+---
+ modules/audio_output/audiotrack.c | 15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
+index eb3ee4f4dc..b77205acb9 100644
+--- a/modules/audio_output/audiotrack.c
++++ b/modules/audio_output/audiotrack.c
+@@ -1426,6 +1426,15 @@ Stop( audio_output_t *p_aout )
+     else
+         vlc_mutex_unlock(  &p_sys->lock );
+ 
++    if( p_sys->p_dp )
++    {
++        JNI_CALL_INT( p_sys->p_dp, jfields.DynamicsProcessing.setEnabled, false );
++        CHECK_AT_EXCEPTION( "DynamicsProcessing.setEnabled" );
++
++        (*env)->DeleteGlobalRef( env, p_sys->p_dp );
++        p_sys->p_dp = NULL;
++    }
++
+     /* Release the AudioTrack object */
+     if( p_sys->p_audiotrack )
+     {
+@@ -1439,12 +1448,6 @@ Stop( audio_output_t *p_aout )
+         p_sys->p_audiotrack = NULL;
+     }
+ 
+-    if( p_sys->p_dp )
+-    {
+-        (*env)->DeleteGlobalRef( env, p_sys->p_dp );
+-        p_sys->p_dp = NULL;
+-    }
+-
+     /* Release the timestamp object */
+     if( p_sys->timestamp.p_obj )
+     {
+-- 
+2.30.2
+



More information about the Android mailing list