vo: remove frame timing check from vo_still_displaying()

This timing dependency does not guarantee that we will wake up in the
future, depending on processing times.
This commit is contained in:
Kacper Michajłow 2023-10-06 22:55:02 +02:00 committed by Dudemanguy
parent 44c398c3e1
commit ef11d31c3a
1 changed files with 3 additions and 10 deletions

View File

@ -1182,16 +1182,9 @@ void vo_seek_reset(struct vo *vo)
bool vo_still_displaying(struct vo *vo)
{
struct vo_internal *in = vo->in;
pthread_mutex_lock(&vo->in->lock);
int64_t now = mp_time_us();
int64_t frame_end = 0;
if (in->current_frame) {
frame_end = in->current_frame->pts + MPMAX(in->current_frame->duration, 0);
if (in->current_frame->display_synced)
frame_end = in->current_frame->num_vsyncs > 0 ? INT64_MAX : 0;
}
bool working = now < frame_end || in->rendering || in->frame_queued;
pthread_mutex_unlock(&vo->in->lock);
pthread_mutex_lock(&in->lock);
bool working = in->rendering || in->frame_queued;
pthread_mutex_unlock(&in->lock);
return working && in->hasframe;
}