From e3ba3f6aca3b90c74c07e6245e1b1a9e91ae08f4 Mon Sep 17 00:00:00 2001 From: melonedo <44501064+melonedo@users.noreply.github.com> Date: Sun, 29 Sep 2024 09:22:51 +0800 Subject: [PATCH] Reset performance counter with GPU image Otherwise `gpujpeg_coder_get_stats` would fail because a counter is neither started nor reset. --- src/gpujpeg_encoder.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gpujpeg_encoder.c b/src/gpujpeg_encoder.c index 04cba43a..9f906297 100644 --- a/src/gpujpeg_encoder.c +++ b/src/gpujpeg_encoder.c @@ -392,6 +392,7 @@ gpujpeg_encoder_encode(struct gpujpeg_encoder* encoder, const struct gpujpeg_par } else if (input->type == GPUJPEG_ENCODER_INPUT_GPU_IMAGE) { coder->d_data_raw = input->image; + coder->duration_memory_to.started = 0; } else if ( input->type == GPUJPEG_ENCODER_INPUT_OPENGL_TEXTURE ) { assert(input->texture != NULL);