[vlc-commits] vout: add vout_FlushAll() to flush all pending pictures
Steve Lhomme
git at videolan.org
Wed Jul 4 08:59:04 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 3 11:56:37 2018 +0200| [77b0a14b25015090a427306372449273e1cf6c54] | committer: Steve Lhomme
vout: add vout_FlushAll() to flush all pending pictures
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=77b0a14b25015090a427306372449273e1cf6c54
---
src/video_output/video_output.c | 3 ++-
src/video_output/vout_internal.h | 5 +++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index ac51d4437b..bd10014314 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1311,7 +1311,8 @@ static void ThreadFlush(vout_thread_t *vout, bool below, vlc_tick_t date)
picture_t *last = vout->p->displayed.decoded;
if (last) {
- if (( below && last->date <= date) ||
+ if ((date == VLC_TICK_INVALID) ||
+ ( below && last->date <= date) ||
(!below && last->date >= date)) {
picture_Release(last);
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index feacb10a61..86c7cc5b24 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -248,6 +248,11 @@ void vout_GetResetStatistic( vout_thread_t *p_vout, unsigned *pi_displayed,
*/
void vout_Flush( vout_thread_t *p_vout, vlc_tick_t i_date );
+/**
+ * Empty all the pending pictures in the vout
+ */
+#define vout_FlushAll( vout ) vout_Flush( vout, VLC_TICK_INVALID )
+
/*
* Cancel the vout, if cancel is true, it won't return any pictures after this
* call.
More information about the vlc-commits
mailing list