]> git.sesse.net Git - vlc/commitdiff
audiotrack: fix deadlock if JNIThread has an error
authorThomas Guillem <thomas@gllm.fr>
Wed, 11 Mar 2015 14:00:47 +0000 (15:00 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 11 Mar 2015 14:12:43 +0000 (15:12 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/audio_output/audiotrack.c

index 922e8a2233a322ad73cb1569c6ddce5f1b36d301..d388d1a8847b2e41d5390346f7c73017d2daaddb 100644 (file)
@@ -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 )
         {