Fix decoding.

This commit is contained in:
Luke Curley 2023-05-23 15:15:53 -07:00
parent f4c8c6cf89
commit 05fccc2ae8
1 changed files with 4 additions and 4 deletions

View File

@ -29,14 +29,14 @@ export default class Decoder {
async receiveSegment(msg: Message.Segment) { async receiveSegment(msg: Message.Segment) {
// Wait for the init segment to be fully received and parsed // Wait for the init segment to be fully received and parsed
const init = await this.init.info await this.init.info
const input = MP4.New() const input = MP4.New()
input.onSamples = this.onSamples.bind(this) input.onSamples = this.onSamples.bind(this)
input.onReady = (track: any) => { input.onReady = (info: MP4.Info) => {
// Extract all of the tracks, because we don't know if it's audio or video. // Extract all of the tracks, because we don't know if it's audio or video.
for (const i of init.tracks) { for (const track of info.tracks) {
input.setExtractionOptions(track.id, i, { nbSamples: 1 }) input.setExtractionOptions(track.id, track, { nbSamples: 1 })
} }
input.start() input.start()