Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/contribute/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class Container {
}

this.#track = this.#mp4.addTrack(options)
if (!this.#track) throw new Error("failed to initialize MP4 track")
if (!this.#track || !this.#mp4.ftyp || !this.#mp4.moov) throw new Error("failed to initialize MP4 track")

const buffer = MP4.ISOFile.writeInitializationSegment(this.#mp4.ftyp, this.#mp4.moov, 0, 0)
const data = new Uint8Array(buffer)
Expand Down
2 changes: 2 additions & 0 deletions lib/media/mp4/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ MP4.BoxParser.dOpsBox.prototype.write = function (stream: MP4.Stream) {
stream.writeInt16(this.OutputGain)
stream.writeUint8(this.ChannelMappingFamily)

if (!this.StreamCount || !this.CoupledCount) throw new Error("failed to write dOps box")

if (this.ChannelMappingFamily !== 0) {
stream.writeUint8(this.StreamCount)
stream.writeUint8(this.CoupledCount)
Expand Down
1 change: 1 addition & 0 deletions lib/transport/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export class Decoder {
case Msg.SubscribeError:
return this.subscribe_error()
case Msg.SubscribeDone:
return this.subscribe_done()
case Msg.Unsubscribe:
return this.unsubscribe()
case Msg.Announce:
Expand Down