|
| 1 | +// Note that these two fixes have been applied: |
| 2 | +// https://github.com/w3c/webcodecs/issues/332#issuecomment-1077442192 |
| 3 | +// Ctrl+F for "firstCueWritten" and "MAX_CLUSTER_DURATION_MSEC" to see the changes. |
| 4 | + |
1 | 5 | /**
|
2 | 6 | * A tool for presenting an ArrayBuffer as a stream for writing some simple data
|
3 | 7 | * types.
|
@@ -630,7 +634,7 @@ function writeEBML(buffer, bufferFileOffset, ebml) {
|
630 | 634 | */
|
631 | 635 | let WebMWriter = function(ArrayBufferDataStream, BlobBuffer) {
|
632 | 636 | return function(options) {
|
633 |
| - let MAX_CLUSTER_DURATION_MSEC = 5000000, DEFAULT_TRACK_NUMBER = 1, |
| 637 | + let MAX_CLUSTER_DURATION_MSEC = 5000, DEFAULT_TRACK_NUMBER = 1, |
634 | 638 | writtenHeader = false, videoWidth = 0, videoHeight = 0,
|
635 | 639 | firstTimestampEver = true, earliestTimestamp = 0,
|
636 | 640 |
|
@@ -972,7 +976,11 @@ let WebMWriter = function(ArrayBufferDataStream, BlobBuffer) {
|
972 | 976 | * CuePoints (use addCuePoint()). The seek entry for the Cues in the
|
973 | 977 | * SeekHead is updated.
|
974 | 978 | */
|
| 979 | + let firstCueWritten = false; |
975 | 980 | function writeCues() {
|
| 981 | + if(firstCueWritten) return; |
| 982 | + firstCueWritten = true; |
| 983 | + |
976 | 984 | let ebml = {'id': 0x1C53BB6B, 'data': cues},
|
977 | 985 |
|
978 | 986 | cuesBuffer = new ArrayBufferDataStream(
|
|
0 commit comments