Skip to content

Commit 6a23dc9

Browse files
authored
Merge pull request #58 from mcintyrehh/fix-build-step
Fix build step and SubscribeDone handling
2 parents 86a7aa3 + d09458e commit 6a23dc9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

lib/contribute/container.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class Container {
7272
}
7373

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

7777
const buffer = MP4.ISOFile.writeInitializationSegment(this.#mp4.ftyp, this.#mp4.moov, 0, 0)
7878
const data = new Uint8Array(buffer)

lib/media/mp4/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ MP4.BoxParser.dOpsBox.prototype.write = function (stream: MP4.Stream) {
2727
stream.writeInt16(this.OutputGain)
2828
stream.writeUint8(this.ChannelMappingFamily)
2929

30+
if (!this.StreamCount || !this.CoupledCount) throw new Error("failed to write dOps box")
31+
3032
if (this.ChannelMappingFamily !== 0) {
3133
stream.writeUint8(this.StreamCount)
3234
stream.writeUint8(this.CoupledCount)

lib/transport/control.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ export class Decoder {
309309
case Msg.SubscribeError:
310310
return this.subscribe_error()
311311
case Msg.SubscribeDone:
312+
return this.subscribe_done()
312313
case Msg.Unsubscribe:
313314
return this.unsubscribe()
314315
case Msg.Announce:

0 commit comments

Comments
 (0)