Commit de67c3f7 authored by Laurent Aimar's avatar Laurent Aimar

Fixed vout_Reset.

parent a274331e
...@@ -567,17 +567,21 @@ void vout_GetResetStatistic( vout_thread_t *p_vout, int *pi_displayed, int *pi_l ...@@ -567,17 +567,21 @@ void vout_GetResetStatistic( vout_thread_t *p_vout, int *pi_displayed, int *pi_l
pi_displayed, pi_lost ); 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); vlc_assert_locked(&vout->p->picture_lock);
vout->p->step.timestamp = VLC_TS_INVALID; vout->p->step.timestamp = VLC_TS_INVALID;
vout->p->step.last = VLC_TS_INVALID; vout->p->step.last = VLC_TS_INVALID;
picture_t *last = vout->p->displayed.decoded; picture_t *last = vout->p->displayed.decoded;
if (last && if (last) {
(( below && last->date <= date) || if (reset) {
(!below && last->date >= date))) { picture_Release(last);
vout->p->step.is_requested = true; 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 ); picture_fifo_Flush( vout->p->decoder_fifo, date, below );
} }
...@@ -586,7 +590,7 @@ void vout_Flush(vout_thread_t *vout, mtime_t date) ...@@ -586,7 +590,7 @@ void vout_Flush(vout_thread_t *vout, mtime_t date)
{ {
vlc_mutex_lock(&vout->p->picture_lock); vlc_mutex_lock(&vout->p->picture_lock);
Flush(vout, date, false); Flush(vout, date, false, false);
vlc_cond_signal(&vout->p->picture_wait); vlc_cond_signal(&vout->p->picture_wait);
vlc_mutex_unlock(&vout->p->picture_lock); vlc_mutex_unlock(&vout->p->picture_lock);
...@@ -596,7 +600,7 @@ void vout_Reset(vout_thread_t *vout) ...@@ -596,7 +600,7 @@ void vout_Reset(vout_thread_t *vout)
{ {
vlc_mutex_lock(&vout->p->picture_lock); vlc_mutex_lock(&vout->p->picture_lock);
Flush(vout, INT64_MAX, true); Flush(vout, INT64_MAX, true, true);
if (vout->p->decoder_pool) if (vout->p->decoder_pool)
picture_pool_NonEmpty(vout->p->decoder_pool, true); picture_pool_NonEmpty(vout->p->decoder_pool, true);
vout->p->pause.is_on = false; vout->p->pause.is_on = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment