1
1
#![ expect( clippy:: unwrap_used) ] // It's a test!
2
2
3
- use std:: cell:: Cell ;
4
-
5
3
use re_chunk_store:: RowId ;
6
4
use re_log_types:: { NonMinI64 , TimePoint } ;
7
5
use re_test_context:: { TestContext , external:: egui_kittest:: SnapshotOptions } ;
@@ -273,10 +271,6 @@ fn test_video(video_type: VideoType, codec: VideoCodec) {
273
271
let step_dt_seconds = 1.0 / 4.0 ; // This is also the current egui_kittest default, but let's be explicit since we use `try_run_realtime`.
274
272
let max_total_time_seconds = 60.0 ;
275
273
276
- // Using a single harness for all frames - we want to make sure that we use the same decoder,
277
- // not tearing down the video player!
278
- let desired_seek_ns = Cell :: new ( 0 ) ;
279
-
280
274
let mut harness = test_context
281
275
. setup_kittest_for_rendering ( )
282
276
. with_step_dt ( step_dt_seconds)
@@ -285,17 +279,16 @@ fn test_video(video_type: VideoType, codec: VideoCodec) {
285
279
. build_ui ( |ui| {
286
280
test_context. run_with_single_view ( ui, view_id) ;
287
281
288
- test_context. with_blueprint_ctx ( |ctx| {
289
- ctx. set_time ( NonMinI64 :: new ( desired_seek_ns. get ( ) ) . unwrap ( ) ) ;
290
- } ) ;
291
-
292
282
std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 20 ) ) ;
293
283
} ) ;
294
284
295
285
for seek_location in VideoTestSeekLocation :: ALL {
296
- desired_seek_ns. set ( seek_location. get_time_ns ( & frame_timestamps_nanos) ) ;
297
-
298
- // Since we can't access `test_context` after creating `harness`, we have to do the seeking in here.
286
+ // Using a single harness for all frames - we want to make sure that we use the same decoder,
287
+ // not tearing down the video player!
288
+ let desired_seek_ns = seek_location. get_time_ns ( & frame_timestamps_nanos) ;
289
+ test_context. with_blueprint_ctx ( |ctx| {
290
+ ctx. set_time ( NonMinI64 :: new ( desired_seek_ns) . unwrap ( ) ) ;
291
+ } ) ;
299
292
300
293
// Video decoding happens in a different thread, so it's important that we give it time
301
294
// and don't busy loop.
0 commit comments