ffav_sys/avutil/timestamp.rs
1use crate::{av_q2d, AVRational, AV_NOPTS_VALUE};
2
3pub fn av_ts2str(ts: i64) -> String {
4 if ts == AV_NOPTS_VALUE {
5 "NOPTS".to_string()
6 } else {
7 ts.to_string()
8 }
9}
10
11pub fn av_ts2timestr(ts: i64, tb: &AVRational) -> String {
12 if ts == AV_NOPTS_VALUE {
13 "NOPTS".to_string()
14 } else {
15 unsafe { (av_q2d(*tb) * ts as f64).to_string() }
16 }
17}