Expose the encoder's fixed 1024-sample priming as encoder_delay()
Browse files at this commit59ecff35584c221ba0f0c131952dc7f0deaa3435Parent: 5f3844f- feat
- expose the encoder's fixed 1024-sample priming as encoder_delay()
1 changed file +8 -0
crates/ec-aac/src/encode.rsmodified+8 -0
| @@ -125,6 +125,14 @@ pub struct AacEncoder { | |||
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | impl AacEncoder { | 127 | impl AacEncoder { |
| 128 | + /// Samples this encoder emits before the first audible one: one MDCT | ||
| 129 | + /// window's worth, always, because the very first frame has no previous | ||
| 130 | + /// block to overlap-add against and is pure priming. A muxer writing this | ||
| 131 | + /// track's `elst`/`CodecDelay` states it here. | ||
| 132 | + pub fn encoder_delay(&self) -> usize { | ||
| 133 | + 1024 | ||
| 134 | + } | ||
| 135 | + | ||
| 128 | pub fn new(config: AacEncoderConfig) -> AacEncoder { | 136 | pub fn new(config: AacEncoderConfig) -> AacEncoder { |
| 129 | AacEncoder { | 137 | AacEncoder { |
| 130 | config, | 138 | config, |