From e84c78d4d8c44eb5ae62c16d0c3dda112d0e770d Mon Sep 17 00:00:00 2001 From: noacoohen Date: Wed, 29 May 2024 15:49:21 +0300 Subject: [PATCH] set stream_type hold the value itself --- src/uvc-sensor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uvc-sensor.cpp b/src/uvc-sensor.cpp index b6d6de21df..847647f736 100644 --- a/src/uvc-sensor.cpp +++ b/src/uvc-sensor.cpp @@ -154,10 +154,10 @@ void uvc_sensor::open( const stream_profiles & requests ) expected_size = 64; // 32; // D457 - WORKAROUND - SHOULD BE REMOVED AFTER CORRECTION IN DRIVER //Motion stream on uvc is used only for mipi. Stream frame number counts gyro and accel together. //We override it using 2 seperate counters. - auto stream_type = (uint8_t *)f.pixels; - if( stream_type[0] == 1 ) // 1 == Accel + auto stream_type = ((uint8_t *)f.pixels)[0]; + if( stream_type == 1 ) // 1 == Accel fr->additional_data.frame_number = ++_accel_counter; - else if( stream_type[0] == 2 ) // 2 == Gyro + else if( stream_type == 2 ) // 2 == Gyro fr->additional_data.frame_number = ++_gyro_counter; frame_counter = fr->additional_data.frame_number; }