[vlc-devel] [PATCH 2/5] vout: change vout_Cancel arguments

Thomas Guillem thomas at gllm.fr
Fri Dec 11 13:34:45 CET 2015


Add a boolean to reset the cancel state to false
---
 src/input/decoder.c             |  2 +-
 src/video_output/video_output.c | 10 +++++-----
 src/video_output/vout_control.h |  5 +++--
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 6d6e3a4..83031ba 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1875,7 +1875,7 @@ void input_DecoderDelete( decoder_t *p_dec )
      * This unblocks the thread, allowing the decoder module to join all its
      * worker threads (if any) and the decoder thread to terminate. */
     if( p_owner->p_vout != NULL )
-        vout_Cancel( p_owner->p_vout );
+        vout_Cancel( p_owner->p_vout, true );
     vlc_mutex_unlock( &p_owner->lock );
 
     vlc_join( p_owner->thread, NULL );
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index d8cb4cc..9b2f0e4 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -303,9 +303,9 @@ static void VoutDestructor(vlc_object_t *object)
 }
 
 /* */
-void vout_Cancel(vout_thread_t *vout)
+void vout_Cancel(vout_thread_t *vout, bool canceled)
 {
-    vout_control_PushVoid(&vout->p->control, VOUT_CONTROL_CANCEL);
+    vout_control_PushBool(&vout->p->control, VOUT_CONTROL_CANCEL, canceled);
     vout_control_WaitEmpty(&vout->p->control);
 }
 
@@ -1455,9 +1455,9 @@ static int ThreadReinit(vout_thread_t *vout,
     return VLC_SUCCESS;
 }
 
-static void ThreadCancel(vout_thread_t *vout)
+static void ThreadCancel(vout_thread_t *vout, bool canceled)
 {
-    picture_pool_Cancel(vout->p->decoder_pool, true);
+    picture_pool_Cancel(vout->p->decoder_pool, canceled);
 }
 
 static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
@@ -1480,7 +1480,7 @@ static int ThreadControl(vout_thread_t *vout, vout_control_cmd_t cmd)
             return 1;
         break;
     case VOUT_CONTROL_CANCEL:
-        ThreadCancel(vout);
+        ThreadCancel(vout, cmd.u.boolean);
         break;
     case VOUT_CONTROL_SUBPICTURE:
         ThreadDisplaySubpicture(vout, cmd.u.subpicture);
diff --git a/src/video_output/vout_control.h b/src/video_output/vout_control.h
index 2c73c9a..a9ba29c 100644
--- a/src/video_output/vout_control.h
+++ b/src/video_output/vout_control.h
@@ -53,9 +53,10 @@ void vout_Flush( vout_thread_t *p_vout, mtime_t i_date );
 void vout_Reset( vout_thread_t *p_vout );
 
 /*
- * Cancel the vout, it won't return any pictures after this call.
+ * Cancel the vout, if cancel is true, it won't return any pictures after this
+ * call.
  */
-void vout_Cancel( vout_thread_t *p_vout );
+void vout_Cancel( vout_thread_t *p_vout, bool b_canceled );
 
 /**
  * This function will force to display the next picture while paused
-- 
2.1.4



More information about the vlc-devel mailing list