forked from mirrors/gstreamer-rs
Add Buffer::get_dts_or_pts()
This commit is contained in:
parent
411f54afed
commit
c6c7693550
1 changed files with 9 additions and 0 deletions
|
@ -332,6 +332,15 @@ impl BufferRef {
|
||||||
self.0.dts = dts.to_glib();
|
self.0.dts = dts.to_glib();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_dts_or_pts(&self) -> ClockTime {
|
||||||
|
let val = self.get_dts();
|
||||||
|
if val.is_none() {
|
||||||
|
self.get_pts()
|
||||||
|
} else {
|
||||||
|
val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn get_duration(&self) -> ClockTime {
|
pub fn get_duration(&self) -> ClockTime {
|
||||||
from_glib(self.0.duration)
|
from_glib(self.0.duration)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue