mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-27 05:10:20 +00:00
vo: correctly account for dropped frames
If the framedrop count happens to be incremented with vo_increment_drop_count() during rendering, these increments were counted twice, because these events also set in->dropped_frame.
This commit is contained in:
@@ -677,7 +677,9 @@ static bool render_frame(struct vo *vo)
|
|||||||
// frame currently drawn, while in->current_frame is the potentially next.)
|
// frame currently drawn, while in->current_frame is the potentially next.)
|
||||||
in->current_frame->repeat = true;
|
in->current_frame->repeat = true;
|
||||||
|
|
||||||
if (!in->dropped_frame) {
|
if (in->dropped_frame) {
|
||||||
|
in->drop_count += 1;
|
||||||
|
} else {
|
||||||
in->rendering = true;
|
in->rendering = true;
|
||||||
in->hasframe_rendered = true;
|
in->hasframe_rendered = true;
|
||||||
int64_t prev_drop_count = vo->in->drop_count;
|
int64_t prev_drop_count = vo->in->drop_count;
|
||||||
@@ -714,9 +716,7 @@ static bool render_frame(struct vo *vo)
|
|||||||
in->rendering = false;
|
in->rendering = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in->dropped_frame) {
|
if (!in->dropped_frame) {
|
||||||
in->drop_count += 1;
|
|
||||||
} else {
|
|
||||||
vo->want_redraw = false;
|
vo->want_redraw = false;
|
||||||
in->want_redraw = false;
|
in->want_redraw = false;
|
||||||
in->request_redraw = false;
|
in->request_redraw = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user