//#region src/elements/EFMedia/TimingModel.ts
/**
* For byte-range sliced segments from full track files (FileMediaEngine).
* mediabunny sees segment-relative timestamps since we sliced at segment boundaries,
* so we subtract the segment's CTS to get relative time.
*/
function createByteRangeTiming(data) {
	return { toContainerSeconds(timeMs, segmentId, track) {
		const trackData = data[typeof track.id === "number" ? track.id : Number.parseInt(track.id, 10)];
		if (!trackData) throw new Error("Track not found");
		const segment = trackData.segments[segmentId];
		if (!segment) throw new Error("Segment not found");
		return (timeMs - segment.cts / trackData.timescale * 1e3) / 1e3;
	} };
}
/**
* For JIT transcoded segments (JitMediaEngine).
* Segments are self-contained — just convert ms to seconds.
*/
function createJitTiming() {
	return { toContainerSeconds(timeMs, _segmentId, _track) {
		return timeMs / 1e3;
	} };
}

//#endregion
export { createByteRangeTiming, createJitTiming };
//# sourceMappingURL=TimingModel.js.map