diff --git a/src/picture.c b/src/picture.c index 9739f6f..29d9d4e 100644 --- a/src/picture.c +++ b/src/picture.c @@ -468,12 +468,23 @@ VAStatus RequestEndPicture(VADriverContextP context, VAContextID context_id) * not be load-bearing for rkvdec's reference resolution — Phase 5 * reviewer flagged this as low-probability (VP9/MPEG-2 use the same * pattern and PASS), but this is the only remaining wire-byte diff. + * + * iter30 DIAG: LIBVA_TS_SCALE env-gated multiplier so we can sweep + * timestamp magnitude to test whether small-ts collides with stale + * CAPTURE entries in vb2_find_buffer for HEVC frame 2+ divergence. */ context_object->timestamp_counter++; - surface_object->timestamp.tv_sec = - (time_t)(context_object->timestamp_counter / 1000000); - surface_object->timestamp.tv_usec = - (suseconds_t)(context_object->timestamp_counter % 1000000); + { + uint64_t ns = (uint64_t)context_object->timestamp_counter * 1000; + const char *scale = getenv("LIBVA_TS_SCALE"); + if (scale && scale[0] != '\0') { + uint64_t mul = (uint64_t)strtoull(scale, NULL, 0); + if (mul > 0) + ns *= mul; + } + surface_object->timestamp.tv_sec = (time_t)(ns / 1000000000ULL); + surface_object->timestamp.tv_usec = (suseconds_t)((ns / 1000ULL) % 1000000ULL); + } /* * iter6: request_fd was bound to the surface in BeginPicture from