[vlc-devel] [PATCH] audiotrack: fix crash

Thomas Guillem thomas at gllm.fr
Thu Mar 5 17:17:50 CET 2015


Create the thread after p_aout->sys is set.
---
 modules/audio_output/audiotrack.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index e21e31e..7ac723a 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -1211,6 +1211,16 @@ Open( vlc_object_t *obj )
     vlc_cond_init( &p_sys->cond );
     TAILQ_INIT( &p_sys->thread_cmd_queue );
 
+    p_aout->sys = p_sys;
+    p_aout->start = Start;
+    p_aout->stop = Stop;
+    p_aout->play = Play;
+    p_aout->pause = Pause;
+    p_aout->flush = Flush;
+    p_aout->time_get = TimeGet;
+
+    aout_SoftVolumeInit( p_aout );
+
     /* create JNIThread */
     p_sys->b_thread_run = true;
     if( vlc_clone( &p_sys->thread,
@@ -1222,16 +1232,6 @@ Open( vlc_object_t *obj )
         return VLC_EGENERIC;
     }
 
-    p_aout->sys = p_sys;
-    p_aout->start = Start;
-    p_aout->stop = Stop;
-    p_aout->play = Play;
-    p_aout->pause = Pause;
-    p_aout->flush = Flush;
-    p_aout->time_get = TimeGet;
-
-    aout_SoftVolumeInit( p_aout );
-
     return VLC_SUCCESS;
 }
 
-- 
2.1.3




More information about the vlc-devel mailing list