pub enum DecoderSeekOutcome {
Landed {
landed_at: Duration,
landed_frame: u64,
landed_byte: Option<u64>,
preroll: PrerollHint,
},
PastEof {
duration: Duration,
},
}Expand description
Outcome of a Decoder::seek call.
Landed.landed_at is the position the decoder actually parked at
(often the granule boundary nearest the requested target — never
the requested target itself unless it coincides). PastEof carries
the decoder’s known total duration so the caller can park at EOF
without rounding.
Variants§
Landed
Decoder is now parked at landed_at / landed_frame /
landed_byte. All three come from the decoder’s own state
and refer to the same point. landed_byte, when present,
is the absolute byte offset in the underlying source where
the next packet body begins — the pipeline plugs it into
Stream::seek so we never recompute byte offsets from
frame × bytes_per_frame heuristics on the consumer side.
None is reserved for the rare case where the decoder
successfully seeked but cannot expose a packet-aligned byte
offset (e.g. AudioFile on a streaming MP3 whose seek-table
is not yet built). For those, the pipeline relies on the
producer-side Stream::byte_position updated by the
decoder’s own Read::seek calls — no extra arithmetic.
Fields
preroll: PrerollHintHint from the demuxer: an earlier byte position the source must
still hold so the decoder can warm MDCT overlap-add state before
emitting user-visible samples. NotNeeded until a demuxer
computes a meaningful pre-roll hint (file backend by byte offset
back, HLS by prev segment start); consumed by the audio pipeline
to warm MDCT overlap-add state before emitting user-visible
chunks.
PastEof
Seek target was past the decoder’s known duration. The decoder
is parked at the end; the next next_chunk returns
DecoderChunkOutcome::Eof.
Trait Implementations§
Source§impl Clone for DecoderSeekOutcome
impl Clone for DecoderSeekOutcome
Source§fn clone(&self) -> DecoderSeekOutcome
fn clone(&self) -> DecoderSeekOutcome
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecoderSeekOutcome
impl Debug for DecoderSeekOutcome
Source§impl PartialEq for DecoderSeekOutcome
impl PartialEq for DecoderSeekOutcome
Source§fn eq(&self, other: &DecoderSeekOutcome) -> bool
fn eq(&self, other: &DecoderSeekOutcome) -> bool
self and other values to be equal, and is used by ==.