mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-20 10:47:02 +00:00
fix packet timestamps
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
use std::ffi::CStr;
|
||||
use std::ptr;
|
||||
|
||||
use anyhow::Error;
|
||||
use ffmpeg_sys_next::{av_buffer_allocz, av_make_error_string, AVBufferRef, memcpy};
|
||||
@ -53,9 +54,12 @@ pub fn video_variant_id_ref(var: &VideoVariant) -> *mut AVBufferRef {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn id_ref_to_uuid(buf: *mut AVBufferRef) -> Uuid {
|
||||
pub fn id_ref_to_uuid(buf: *mut AVBufferRef) -> Result<Uuid, Error> {
|
||||
unsafe {
|
||||
if buf == ptr::null_mut() {
|
||||
return Err(Error::msg("Buffer was null"));
|
||||
}
|
||||
let binding = Bytes::from(*((*buf).data as *const [u8; 16]));
|
||||
Uuid::from_bytes_ref(&binding).clone()
|
||||
Ok(Uuid::from_bytes_ref(&binding).clone())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user