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
path: root/text
diff options
context:
space:
mode:
authorFrançois Laignel <fengalin@free.fr>2022-10-10 14:55:32 +0300
committerFrançois Laignel <fengalin@free.fr>2022-10-10 20:28:13 +0300
commitbd14e476f16622d59a3a30d762b7f893c7c74614 (patch)
tree30da1afdc1308859231377629b62e9a8df0e7798 /text
parentb1b707008f1995ea1118ab126586704c2e102233 (diff)
Fix direct access to the inner specific formatted values
This is no longer available as this could lead to building a defined value in Rust which could be interpreted as undefined in C due to the sentinel `u64::MAX` for `None`. Use the constants (e.g. `ONE`, `K`, `M`, ...) and operations to build a value and deref (`*`) to get the quantity as an integer.
Diffstat (limited to 'text')
-rw-r--r--text/json/src/jsongstparse/imp.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs
index 75d8c095d..d6fb16375 100644
--- a/text/json/src/jsongstparse/imp.rs
+++ b/text/json/src/jsongstparse/imp.rs
@@ -415,9 +415,9 @@ impl JsonGstParse {
));
}
- let size = match q.result().try_into().ok().flatten() {
- Some(gst::format::Bytes(size)) => size,
- None => {
+ let size = match q.result() {
+ gst::GenericFormattedValue::Bytes(Some(size)) => *size,
+ _ => {
return Err(gst::loggable_error!(
CAT,
"Failed to query upstream duration"