mirror of
https://github.com/aler9/gortsplib
synced 2025-10-14 11:23:44 +08:00
move AUD logic into mediacommon (#577)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user