[vlc-commits] vout: change vout_Cancel arguments
Thomas Guillem
git at videolan.org
Mon Dec 21 15:52:56 CET 2015
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Dec 11 11:57:55 2015 +0100| [6c786aa537c9b1a80088900c03dadd37c132661f] | committer: Thomas Guillem
vout: change vout_Cancel arguments
Add a boolean to reset the cancel state to false
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6c786aa537c9b1a80088900c03dadd37c132661f
---
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 91f1b51..6e5bde0 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1866,7 +1866,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
More information about the vlc-commits
mailing list