Skip to content

Commit d70788d

Browse files
itouakiraitobbee
authored andcommitted
fix: When the GroupingType of SbgpBox or SgpdBox is roll, the remaining Childen will be missing the box
1 parent df2d886 commit d70788d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mp4/traf.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,30 +271,35 @@ func (t *TrafBox) RemoveEncryptionBoxes() uint64 {
271271
case *SaizBox:
272272
nrBytesRemoved += ch.Size()
273273
t.Saiz = nil
274+
continue
274275
case *SaioBox:
275276
nrBytesRemoved += ch.Size()
276277
t.Saio = nil
278+
continue
277279
case *SencBox:
278280
nrBytesRemoved += ch.Size()
279281
t.Senc = nil
282+
continue
280283
case *UUIDBox:
281284
if box.SubType() == "senc" {
282285
nrBytesRemoved += ch.Size()
283286
t.UUIDSenc = nil
287+
continue
284288
}
285289
case *SbgpBox:
286-
if box.GroupingType == "seig" {
290+
if box.GroupingType == "seig" || box.GroupingType == "seam" {
287291
nrBytesRemoved += ch.Size()
288292
t.Sbgp = nil
293+
continue
289294
}
290295
case *SgpdBox:
291-
if box.GroupingType == "seig" {
296+
if box.GroupingType == "seig" || box.GroupingType == "seam" {
292297
nrBytesRemoved += ch.Size()
293298
t.Sgpd = nil
299+
continue
294300
}
295-
default:
296-
remainingChildren = append(remainingChildren, ch)
297301
}
302+
remainingChildren = append(remainingChildren, ch)
298303
}
299304
t.Children = remainingChildren
300305
return nrBytesRemoved

0 commit comments

Comments
 (0)