scuffle_ffmpeg/utils.rs
1use crate::ffi::*;
2
3/// Checks if a value is AV_NOPTS_VALUE and returns None if it is.
4pub const fn check_i64(val: i64) -> Option<i64> {
5 if val == AV_NOPTS_VALUE {
6 None
7 } else {
8 Some(val)
9 }
10}
11
12/// Returns the value if it is Some, otherwise returns AV_NOPTS_VALUE.
13pub const fn or_nopts(val: Option<i64>) -> i64 {
14 if let Some(val) = val {
15 val
16 } else {
17 AV_NOPTS_VALUE
18 }
19}