[vlc-devel] [PATCH 2/4] vout: add vout_FlushAll() to flush all	pending pictures
    Steve Lhomme 
    robux4 at ycbcr.xyz
       
    Tue Jul  3 12:00:02 CEST 2018
    
    
  
---
 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.
-- 
2.17.0
    
    
More information about the vlc-devel
mailing list