diff --git a/examples/client-play-format-h264-save-to-disk/mpegts_muxer.go b/examples/client-play-format-h264-save-to-disk/mpegts_muxer.go index 99860849..4339bc75 100644 --- a/examples/client-play-format-h264-save-to-disk/mpegts_muxer.go +++ b/examples/client-play-format-h264-save-to-disk/mpegts_muxer.go @@ -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 } diff --git a/examples/client-play-format-h265-save-to-disk/mpegts_muxer.go b/examples/client-play-format-h265-save-to-disk/mpegts_muxer.go index d4cf52a7..71ed13c9 100644 --- a/examples/client-play-format-h265-save-to-disk/mpegts_muxer.go +++ b/examples/client-play-format-h265-save-to-disk/mpegts_muxer.go @@ -53,10 +53,7 @@ func (e *mpegtsMuxer) close() { // writeH265 writes a H265 access unit into MPEG-TS. func (e *mpegtsMuxer) writeH265(au [][]byte, pts time.Duration) error { - // prepend an AUD. This is required by some players - filteredAU := [][]byte{ - {byte(h265.NALUType_AUD_NUT) << 1, 1, 0x50}, - } + var filteredAU [][]byte isRandomAccess := false @@ -87,7 +84,7 @@ func (e *mpegtsMuxer) writeH265(au [][]byte, pts time.Duration) error { au = filteredAU - if len(au) <= 1 { + if au == nil { return nil } diff --git a/examples/server-h264-save-to-disk/mpegts_muxer.go b/examples/server-h264-save-to-disk/mpegts_muxer.go index e988561b..9b198982 100644 --- a/examples/server-h264-save-to-disk/mpegts_muxer.go +++ b/examples/server-h264-save-to-disk/mpegts_muxer.go @@ -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 } diff --git a/go.mod b/go.mod index 05e5a94e..7a036cd6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/bluenviron/gortsplib/v4 go 1.20 require ( - github.com/bluenviron/mediacommon v1.11.0 + github.com/bluenviron/mediacommon v1.11.1-0.20240525122142-20163863aa75 github.com/google/uuid v1.6.0 github.com/pion/rtcp v1.2.14 github.com/pion/rtp v1.8.7-0.20240429002300-bc5124c9d0d0 diff --git a/go.sum b/go.sum index f7995bd0..b2a3a093 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/asticode/go-astikit v0.30.0 h1:DkBkRQRIxYcknlaU7W7ksNfn4gMFsB0tqMJflx github.com/asticode/go-astikit v0.30.0/go.mod h1:h4ly7idim1tNhaVkdVBeXQZEE3L0xblP7fCWbgwipF0= github.com/asticode/go-astits v1.13.0 h1:XOgkaadfZODnyZRR5Y0/DWkA9vrkLLPLeeOvDwfKZ1c= github.com/asticode/go-astits v1.13.0/go.mod h1:QSHmknZ51pf6KJdHKZHJTLlMegIrhega3LPWz3ND/iI= -github.com/bluenviron/mediacommon v1.11.0 h1:1xY4QGYz7da9tsV2Xvd+ol+Ul5qq2g7ADJtIlVkQSRI= -github.com/bluenviron/mediacommon v1.11.0/go.mod h1:HDyW2CzjvhYJXtdxstdFPio3G0qSocPhqkhUt/qffec= +github.com/bluenviron/mediacommon v1.11.1-0.20240525122142-20163863aa75 h1:5P8Um+ySuwZApuVS9gI6U0MnrIFybTfLrZSqV2ie5lA= +github.com/bluenviron/mediacommon v1.11.1-0.20240525122142-20163863aa75/go.mod h1:HDyW2CzjvhYJXtdxstdFPio3G0qSocPhqkhUt/qffec= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=