[vlc-commits] audiotrack: fix deadlock if JNIThread has an error

Thomas Guillem git at videolan.org
Wed Mar 11 15:21:07 CET 2015


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Mar 11 15:00:47 2015 +0100| [3bf7858739fcacda95cf5419190eae3c68371912] | committer: Jean-Baptiste Kempf

audiotrack: fix deadlock if JNIThread has an error

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3bf7858739fcacda95cf5419190eae3c68371912
---

 modules/audio_output/audiotrack.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/modules/audio_output/audiotrack.c b/modules/audio_output/audiotrack.c
index 922e8a2..d388d1a 100644
--- a/modules/audio_output/audiotrack.c
+++ b/modules/audio_output/audiotrack.c
@@ -1183,7 +1183,10 @@ JNIThread( void *data )
             case CMD_TIME_GET:
                 assert( p_sys->p_audiotrack );
                 if( b_error )
+                {
+                    p_cmd->out.time_get.i_ret = -1;
                     break;
+                }
                 p_cmd->out.time_get.i_ret =
                         JNIThread_TimeGet( env, p_aout,
                                            &p_cmd->out.time_get.i_delay );
@@ -1202,6 +1205,8 @@ JNIThread( void *data )
         }
         if( p_sys->b_audiotrack_exception )
             b_error = true;
+        if( b_error )
+            p_sys->i_samples_queued = 0;
 
         if( b_remove_cmd )
         {



More information about the vlc-commits mailing list