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 { None } else { Some(val) }
6}
7
8/// Returns the value if it is Some, otherwise returns AV_NOPTS_VALUE.
9pub const fn or_nopts(val: Option<i64>) -> i64 {
10    if let Some(val) = val { val } else { AV_NOPTS_VALUE }
11}