[vlc-commits] commit: Fixed vout_Reset. (Laurent Aimar )

git at videolan.org git at videolan.org
Sat Apr 24 00:01:42 CEST 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Apr 23 22:54:58 2010 +0200| [de67c3f773660b926545da3717f896a1e6109e29] | committer: Laurent Aimar 

Fixed vout_Reset.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de67c3f773660b926545da3717f896a1e6109e29
---

 src/video_output/video_output.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 30010e7..a2f2596 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -567,17 +567,21 @@ void vout_GetResetStatistic( vout_thread_t *p_vout, int *pi_displayed, int *pi_l
                              pi_displayed, pi_lost );
 }
 
-static void Flush(vout_thread_t *vout, mtime_t date, bool below)
+static void Flush(vout_thread_t *vout, mtime_t date, bool reset, bool below)
 {
     vlc_assert_locked(&vout->p->picture_lock);
     vout->p->step.timestamp = VLC_TS_INVALID;
     vout->p->step.last      = VLC_TS_INVALID;
 
     picture_t *last = vout->p->displayed.decoded;
-    if (last &&
-        (( below  && last->date <= date) ||
-          (!below && last->date >= date))) {
-        vout->p->step.is_requested = true;
+    if (last) {
+        if (reset) {
+            picture_Release(last);
+            vout->p->displayed.decoded = NULL;
+        } else if (( below  && last->date <= date) ||
+                   (!below && last->date >= date)) {
+            vout->p->step.is_requested = true;
+        }
     }
     picture_fifo_Flush( vout->p->decoder_fifo, date, below );
 }
@@ -586,7 +590,7 @@ void vout_Flush(vout_thread_t *vout, mtime_t date)
 {
     vlc_mutex_lock(&vout->p->picture_lock);
 
-    Flush(vout, date, false);
+    Flush(vout, date, false, false);
 
     vlc_cond_signal(&vout->p->picture_wait);
     vlc_mutex_unlock(&vout->p->picture_lock);
@@ -596,7 +600,7 @@ void vout_Reset(vout_thread_t *vout)
 {
     vlc_mutex_lock(&vout->p->picture_lock);
 
-    Flush(vout, INT64_MAX, true);
+    Flush(vout, INT64_MAX, true, true);
     if (vout->p->decoder_pool)
         picture_pool_NonEmpty(vout->p->decoder_pool, true);
     vout->p->pause.is_on = false;



More information about the vlc-commits mailing list