mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-06-07 00:39:24 +00:00
cdgparse: fix time to bytes None conversion
Time(None) should be converted to Bytes(None). Fix seeking with stop=-1
This commit is contained in:
parent
288908edc0
commit
9af2823f58
|
@ -96,13 +96,13 @@ fn bytes_to_time(bytes: u64) -> gst::ClockTime {
|
|||
gst::ClockTime::from_nseconds(ns)
|
||||
}
|
||||
|
||||
fn time_to_bytes(time: gst::ClockTime) -> Option<Bytes> {
|
||||
fn time_to_bytes(time: gst::ClockTime) -> Bytes {
|
||||
match time.nseconds() {
|
||||
Some(time) => {
|
||||
let bytes = time.mul_div_round(CDG_PACKET_PERIOD * CDG_PACKET_SIZE as u64, SECOND_VAL);
|
||||
Some(Bytes(bytes))
|
||||
Bytes(bytes)
|
||||
}
|
||||
None => None,
|
||||
None => Bytes(None),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -212,10 +212,7 @@ impl BaseParseImpl for CdgParse {
|
|||
gst::GenericFormattedValue::Time(bytes_to_time(bytes.unwrap())),
|
||||
),
|
||||
(gst::GenericFormattedValue::Time(time), gst::Format::Bytes) => {
|
||||
match time_to_bytes(time) {
|
||||
Some(bytes) => Some(gst::GenericFormattedValue::Bytes(bytes)),
|
||||
None => None,
|
||||
}
|
||||
Some(time_to_bytes(time).into())
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue