mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 18:40:32 +00:00
Simplify some more code
This commit is contained in:
parent
cef8d28974
commit
9e2c25653f
1 changed files with 4 additions and 16 deletions
|
@ -440,10 +440,7 @@ impl Buffer {
|
||||||
fn gst_rs_buffer_set_offset(buf: *const c_void, offset: u64);
|
fn gst_rs_buffer_set_offset(buf: *const c_void, offset: u64);
|
||||||
}
|
}
|
||||||
|
|
||||||
let offset = match offset {
|
let offset = offset.unwrap_or(u64::MAX);
|
||||||
None => u64::MAX,
|
|
||||||
Some(offset) => offset,
|
|
||||||
};
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
gst_rs_buffer_set_offset(self.raw, offset);
|
gst_rs_buffer_set_offset(self.raw, offset);
|
||||||
|
@ -475,10 +472,7 @@ impl Buffer {
|
||||||
fn gst_rs_buffer_set_offset_end(buf: *const c_void, offset_end: u64);
|
fn gst_rs_buffer_set_offset_end(buf: *const c_void, offset_end: u64);
|
||||||
}
|
}
|
||||||
|
|
||||||
let offset_end = match offset_end {
|
let offset_end = offset_end.unwrap_or(u64::MAX);
|
||||||
None => u64::MAX,
|
|
||||||
Some(offset_end) => offset_end,
|
|
||||||
};
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
gst_rs_buffer_set_offset_end(self.raw, offset_end);
|
gst_rs_buffer_set_offset_end(self.raw, offset_end);
|
||||||
|
@ -506,10 +500,7 @@ impl Buffer {
|
||||||
fn gst_rs_buffer_set_pts(buf: *const c_void, pts: u64);
|
fn gst_rs_buffer_set_pts(buf: *const c_void, pts: u64);
|
||||||
}
|
}
|
||||||
|
|
||||||
let pts = match pts {
|
let pts = pts.unwrap_or(u64::MAX);
|
||||||
None => u64::MAX,
|
|
||||||
Some(pts) => pts,
|
|
||||||
};
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
gst_rs_buffer_set_pts(self.raw, pts);
|
gst_rs_buffer_set_pts(self.raw, pts);
|
||||||
|
@ -537,10 +528,7 @@ impl Buffer {
|
||||||
fn gst_rs_buffer_set_dts(buf: *const c_void, dts: u64);
|
fn gst_rs_buffer_set_dts(buf: *const c_void, dts: u64);
|
||||||
}
|
}
|
||||||
|
|
||||||
let dts = match dts {
|
let dts = dts.unwrap_or(u64::MAX);
|
||||||
None => u64::MAX,
|
|
||||||
Some(dts) => dts,
|
|
||||||
};
|
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
gst_rs_buffer_set_dts(self.raw, dts);
|
gst_rs_buffer_set_dts(self.raw, dts);
|
||||||
|
|
Loading…
Reference in a new issue