move AUD logic into mediacommon (#577)

This commit is contained in:
Alessandro Ros
2024-05-25 14:38:12 +02:00
committed by GitHub
parent a9149e031f
commit b3204e7cda
5 changed files with 9 additions and 18 deletions

View File

@@ -52,10 +52,7 @@ func (e *mpegtsMuxer) close() {
// writeH264 writes a H264 access unit into MPEG-TS.
func (e *mpegtsMuxer) writeH264(au [][]byte, pts time.Duration) error {
// prepend an AUD. This is required by some players
filteredAU := [][]byte{
{byte(h264.NALUTypeAccessUnitDelimiter), 240},
}
var filteredAU [][]byte
nonIDRPresent := false
idrPresent := false
@@ -86,7 +83,7 @@ func (e *mpegtsMuxer) writeH264(au [][]byte, pts time.Duration) error {
au = filteredAU
if len(au) <= 1 || (!nonIDRPresent && !idrPresent) {
if au == nil || (!nonIDRPresent && !idrPresent) {
return nil
}