From 1da53248ab29d711df5602f3fdff90c45298ec77 Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Mon, 11 Sep 2017 00:27:27 +0200 Subject: vo_opengl: refactor/fix mp_pass_perf code This was needlessly complicated and prone to breakage, because even the references to the ring buffer could end up getting invalidated and containing garbage data on e.g. shader cache flush. For much the same reason why we can't keep around the *timer_pool, we're also forced to hard-copy the entire sample buffer per pass per frame. Not a huge deal, though. This is, what, a few kB per frame? We have more pressing CPU performance concerns anyway. Also simplified/fixed some other code. --- player/command.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'player/command.c') diff --git a/player/command.c b/player/command.c index 6dc619d0eb..87709e119c 100644 --- a/player/command.c +++ b/player/command.c @@ -2882,12 +2882,8 @@ static void get_frame_perf(struct mpv_node *node, struct mp_frame_perf *perf) node_map_add(pass, "peak", MPV_FORMAT_INT64)->u.int64 = data->peak; node_map_add(pass, "count", MPV_FORMAT_INT64)->u.int64 = data->count; struct mpv_node *samples = node_map_add(pass, "samples", MPV_FORMAT_NODE_ARRAY); - - int idx = data->index; - for (int n = 0; n < data->count; n++) { - node_array_add(samples, MPV_FORMAT_INT64)->u.int64 = data->samples[idx]; - idx = (idx + 1) % PERF_SAMPLE_COUNT; - } + for (int n = 0; n < data->count; n++) + node_array_add(samples, MPV_FORMAT_INT64)->u.int64 = data->samples[n]; } } -- cgit v1.2.3