get_frame rebuilt the RGBA swscale context on every decoded frame and printed [Video Timing] lines unconditionally. A stream's frames share one input format/size, so build the scaler once (keyed on format+dims, rebuilt only if they change) and reuse it; gate the per-frame traces behind LB_VIDEO_DEBUG. Cuts export wall time ~10% on a 1080p video clip (the scaler rebuild was the bulk of the per-frame "scale" cost; it's now ~0ms). SwsContext is !Send, so the cached scaler is wrapped in a SendScaler — sound because a VideoDecoder is only ever touched under the VideoManager mutex (same invariant as its decoder/input). |
||
|---|---|---|
| .. | ||
| src | ||
| tests | ||
| Cargo.toml | ||