nx_ts_dur.nx
buildroot/runtime/nx_ts_dur.nx
about
nx_ts_dur.nx -- MPEG-TS total duration via FIRST + LAST PCR (no full-file scan; reads only an
8 MB window at each end). PCR lives in the adaptation field (afc>=2, PCR_flag bit 0x10), a 33-bit
base clock @ 90 kHz. Also reports the PCR endpoints so the daemon can do proportional time<->byte
seeking (byte ~= start + (T-first)/(last-first)*size). Usage: nx_ts_dur <in.ts>
Prints: size=<n> first_pcr90=<n> last_pcr90=<n> dur_ms=<n>. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_vid_dur_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 8 | const K_MAGIC_8589934592: i64 = 8589934592 |
| 10 | const WIN: i64 = 8388608 |
functions
| 12 | func tp_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 13 | func tp_n(v: i64) -> i64 |
| 23 | func scan_pcr(buf: *u8, n: i64, fp: *i64, lp: *i64) -> i64 called by 1: main |
| 46 | func read_window(fd: i64, buf: *u8, cap: i64) -> i64 |
| 52 | func main(argc: i64, argv: *i64) -> i64 |