aboutsummaryrefslogtreecommitdiff
path: root/writer.go
diff options
context:
space:
mode:
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