aboutsummaryrefslogtreecommitdiff
path: root/writer.go
diff options
context:
space:
mode:
authorOnur Gündüz <ogunduz@gmail.com>2026-02-14 01:40:27 +0100
committerOnur Gündüz <ogunduz@gmail.com>2026-02-14 01:40:27 +0100
commit3302c4a4518312df79eb6b6b72a98b7707803750 (patch)
tree738de7e92f36714870120a2bbaedc589a08f8b0f /writer.go
parent0a46cca30ca69cdb97a6fe1f807ef7eacc2ae0f3 (diff)
downloadmp4-3302c4a4518312df79eb6b6b72a98b7707803750.tar.gz
mp4-3302c4a4518312df79eb6b6b72a98b7707803750.zip
Rebranding
Diffstat (limited to 'writer.go')
-rw-r--r--writer.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/writer.go b/writer.go
index c7a1b28..f21e3c6 100644
--- a/writer.go
+++ b/writer.go
@@ -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