diff options
| author | Onur Gündüz <ogunduz@gmail.com> | 2026-02-14 01:40:27 +0100 |
|---|---|---|
| committer | Onur Gündüz <ogunduz@gmail.com> | 2026-02-14 01:40:27 +0100 |
| commit | 3302c4a4518312df79eb6b6b72a98b7707803750 (patch) | |
| tree | 738de7e92f36714870120a2bbaedc589a08f8b0f /writer.go | |
| parent | 0a46cca30ca69cdb97a6fe1f807ef7eacc2ae0f3 (diff) | |
| download | mp4-3302c4a4518312df79eb6b6b72a98b7707803750.tar.gz mp4-3302c4a4518312df79eb6b6b72a98b7707803750.zip | |
Rebranding
Diffstat (limited to 'writer.go')
| -rw-r--r-- | writer.go | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -1,11 +1,11 @@ -package mp4 +package isobmff // writerFrame tracks the start offset of a box for size backpatching. type writerFrame struct { offset int } -// Writer builds MP4 data into a caller-provided fixed-size byte buffer. +// Writer encodes ISOBMFF boxes into a byte buffer. type Writer struct { buf []byte pos int @@ -443,10 +443,7 @@ func (w *Writer) WriteVisualSampleEntry(dataRefIdx, width, height, frameCount, d w.putUint32(0x00480000) // vresolution 72 dpi w.putZeros(4) // reserved w.putUint16(frameCount) // frame count - nameLen := len(compressor) - if nameLen > 31 { - nameLen = 31 - } + nameLen := min(len(compressor), 31) w.putUint8(byte(nameLen)) w.putFixedString(compressor, 31) w.putUint16(depth) // depth |
