mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
@@ -40,7 +40,9 @@ pub const CLIPBOARD_INTERVAL: u64 = 333;
|
||||
pub const SYNC_PEER_INFO_DISPLAYS: i32 = 1;
|
||||
|
||||
#[cfg(all(target_os = "macos", feature = "flutter_texture_render"))]
|
||||
pub const STRIDE_ALIGN: usize = 16;
|
||||
// https://developer.apple.com/forums/thread/712709
|
||||
// Memory alignment should be multiple of 64.
|
||||
pub const STRIDE_ALIGN: usize = 64;
|
||||
#[cfg(not(all(target_os = "macos", feature = "flutter_texture_render")))]
|
||||
pub const STRIDE_ALIGN: usize = 1;
|
||||
|
||||
|
||||
@@ -207,8 +207,8 @@ impl VideoRenderer {
|
||||
self.height = height;
|
||||
self.data_len = if width > 0 && height > 0 {
|
||||
let sa1 = crate::common::STRIDE_ALIGN - 1;
|
||||
let w = (width as usize + sa1) & !sa1;
|
||||
w * (height as usize) * 4
|
||||
let row_bytes = (width as usize * 4 + sa1) & !sa1;
|
||||
row_bytes * height as usize
|
||||
} else {
|
||||
0
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user