Skip to content
Snippets Groups Projects
Commit a97a6944 authored by Thomas Guillem's avatar Thomas Guillem Committed by Nicolas Pomepuy
Browse files

libvlc: rework DynamicsProcessing stop

This commit tries to fix a very rare crash with DP.
parent f3b085ba
No related branches found
No related tags found
1 merge request!1055MediaPlayer: backport 4.0 fast seek argument in setTime/setPosition
Pipeline #126118 canceled with stage
From b0d5fa154e0fc27f6d368977886348269a527aa8 Mon Sep 17 00:00:00 2001
Message-Id: <b0d5fa154e0fc27f6d368977886348269a527aa8.1628587500.git.thomas@gllm.fr>
In-Reply-To: <725e37106e83190ea20042aa9dc01c1c7646b37d.1628587500.git.thomas@gllm.fr>
References: <725e37106e83190ea20042aa9dc01c1c7646b37d.1628587500.git.thomas@gllm.fr>
From: Thomas Guillem <thomas@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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment