Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.com>2019-06-07 13:36:41 +0300
committerGuillaume Desmottes <guillaume.desmottes@collabora.com>2019-06-07 14:27:30 +0300
commit9af2823f588d678d1391073b3337bfec5b8df650 (patch)
treef052d9984f859be47c4fa925ec90f9d569f29fb5
parent288908edc049b547a72531951b0e711f0dbbeaae (diff)
cdgparse: fix time to bytes None conversion
Time(None) should be converted to Bytes(None). Fix seeking with stop=-1
-rw-r--r--gst-plugin-cdg/src/cdgparse.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/gst-plugin-cdg/src/cdgparse.rs b/gst-plugin-cdg/src/cdgparse.rs
index 8a97b2474..4534e76c4 100644
--- a/gst-plugin-cdg/src/cdgparse.rs
+++ b/gst-plugin-cdg/src/cdgparse.rs
@@ -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,
}