mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
gstreamer: Don't implement ClockId's Ord/etc based on the compare function
It is only comparing the times, and two clock ids with the same time are obviously not the same.
This commit is contained in:
parent
2471676aa4
commit
53c98db711
1 changed files with 2 additions and 18 deletions
|
@ -24,7 +24,7 @@ use ClockTime;
|
|||
use ClockTimeDiff;
|
||||
|
||||
glib_wrapper! {
|
||||
#[derive(Debug, Hash)]
|
||||
#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Hash)]
|
||||
pub struct ClockId(Shared<c_void>);
|
||||
|
||||
match fn {
|
||||
|
@ -95,16 +95,8 @@ impl ClockId {
|
|||
};
|
||||
ret.into_result()
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for ClockId {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
impl Ord for ClockId {
|
||||
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
||||
pub fn compare_by_time(&self, other: &Self) -> cmp::Ordering {
|
||||
unsafe {
|
||||
let res = ffi::gst_clock_id_compare_func(self.to_glib_none().0, other.to_glib_none().0);
|
||||
if res < 0 {
|
||||
|
@ -118,14 +110,6 @@ impl Ord for ClockId {
|
|||
}
|
||||
}
|
||||
|
||||
impl PartialEq for ClockId {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.cmp(other) == cmp::Ordering::Equal
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for ClockId {}
|
||||
|
||||
unsafe impl Send for ClockId {}
|
||||
unsafe impl Sync for ClockId {}
|
||||
|
||||
|
|
Loading…
Reference in a new issue