diff options
author | François Laignel <fengalin@free.fr> | 2022-10-10 14:55:32 +0300 |
---|---|---|
committer | François Laignel <fengalin@free.fr> | 2022-10-10 20:28:13 +0300 |
commit | bd14e476f16622d59a3a30d762b7f893c7c74614 (patch) | |
tree | 30da1afdc1308859231377629b62e9a8df0e7798 /text | |
parent | b1b707008f1995ea1118ab126586704c2e102233 (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.rs | 6 |
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" |