From 5ec3d1368322d7d2803a55bcf272dff5a53ab13d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 01:18:28 +0000 Subject: [PATCH] Build(deps): Bump github.com/bluenviron/mediacommon Bumps [github.com/bluenviron/mediacommon](https://github.com/bluenviron/mediacommon) from 1.11.1-0.20240525122142-20163863aa75 to 1.12.4. - [Commits](https://github.com/bluenviron/mediacommon/commits/v1.12.4) --- updated-dependencies: - dependency-name: github.com/bluenviron/mediacommon dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 +- .../mediacommon/pkg/codecs/h264/annexb.go | 81 ++++++++++++------- .../mediacommon/pkg/codecs/h264/avcc.go | 32 +++++--- .../pkg/codecs/h264/dts_extractor.go | 30 ++++++- .../mediacommon/pkg/codecs/h265/sps.go | 76 ++++++++++++++++- .../mediacommon/pkg/codecs/mpeg4audio/adts.go | 4 +- .../codecs/mpeg4audio/stream_mux_config.go | 2 + .../mediacommon/pkg/formats/fmp4/fmp4.go | 4 + .../mediacommon/pkg/formats/fmp4/parts.go | 9 +++ .../pkg/formats/mpegts/codec_unsupported.go | 19 +++++ .../mediacommon/pkg/formats/mpegts/reader.go | 7 -- .../mediacommon/pkg/formats/mpegts/track.go | 18 ++--- vendor/modules.txt | 2 +- 14 files changed, 217 insertions(+), 73 deletions(-) create mode 100644 vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/codec_unsupported.go diff --git a/go.mod b/go.mod index cf97318..76099b5 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.20 require ( github.com/asticode/go-astits v1.13.0 - github.com/bluenviron/mediacommon v1.11.1-0.20240525122142-20163863aa75 + github.com/bluenviron/mediacommon v1.12.4 github.com/stretchr/testify v1.9.0 ) diff --git a/go.sum b/go.sum index 2ce1843..7b95c7c 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,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.1-0.20240525122142-20163863aa75 h1:5P8Um+ySuwZApuVS9gI6U0MnrIFybTfLrZSqV2ie5lA= -github.com/bluenviron/mediacommon v1.11.1-0.20240525122142-20163863aa75/go.mod h1:HDyW2CzjvhYJXtdxstdFPio3G0qSocPhqkhUt/qffec= +github.com/bluenviron/mediacommon v1.12.4 h1:7VrA/W/iDB7VELquXqRjgjzUSJT3llZYgXjFN9WkByo= +github.com/bluenviron/mediacommon v1.12.4/go.mod h1:HDyW2CzjvhYJXtdxstdFPio3G0qSocPhqkhUt/qffec= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= 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= diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/annexb.go b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/annexb.go index f0061c5..37782e2 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/annexb.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/annexb.go @@ -1,33 +1,36 @@ package h264 import ( + "errors" "fmt" ) +// ErrAnnexBNoNALUs is returned by AnnexBUnmarshal when no NALUs have been decoded. +var ErrAnnexBNoNALUs = errors.New("Annex-B unit doesn't contain any NALU") + // AnnexBUnmarshal decodes an access unit from the Annex-B stream format. // Specification: ITU-T Rec. H.264, Annex B func AnnexBUnmarshal(buf []byte) ([][]byte, error) { bl := len(buf) initZeroCount := 0 - start := 0 + i := 0 outer: for { - if start >= bl || start >= 4 { + if i >= bl || i >= 4 { return nil, fmt.Errorf("initial delimiter not found") } switch initZeroCount { case 0, 1: - if buf[start] != 0 { + if buf[i] != 0 { return nil, fmt.Errorf("initial delimiter not found") } initZeroCount++ case 2, 3: - switch buf[start] { + switch buf[i] { case 1: - start++ break outer case 0: @@ -38,20 +41,36 @@ outer: initZeroCount++ } - start++ + i++ } + start := initZeroCount + 1 zeroCount := 0 n := 0 + delimStart := 0 + auSize := 0 for i := start; i < bl; i++ { switch buf[i] { case 0: + if zeroCount == 0 { + delimStart = i + } zeroCount++ case 1: if zeroCount == 2 || zeroCount == 3 { - n++ + l := delimStart - start + + if l != 0 { + if (auSize + l) > MaxAccessUnitSize { + return nil, fmt.Errorf("access unit size (%d) is too big, maximum is %d", auSize+l, MaxAccessUnitSize) + } + n++ + } + + auSize += l + start = i + 1 } zeroCount = 0 @@ -60,17 +79,29 @@ outer: } } - if (n + 1) > MaxNALUsPerAccessUnit { + l := bl - start + + if l != 0 { + if (auSize + l) > MaxAccessUnitSize { + return nil, fmt.Errorf("access unit size (%d) is too big, maximum is %d", auSize+l, MaxAccessUnitSize) + } + n++ + } + + if n == 0 { + return nil, ErrAnnexBNoNALUs + } + + if n > MaxNALUsPerAccessUnit { return nil, fmt.Errorf("NALU count (%d) exceeds maximum allowed (%d)", - n+1, MaxNALUsPerAccessUnit) + n, MaxNALUsPerAccessUnit) } - ret := make([][]byte, n+1) + ret := make([][]byte, n) pos := 0 start = initZeroCount + 1 zeroCount = 0 - delimStart := 0 - auSize := 0 + delimStart = 0 for i := start; i < bl; i++ { switch buf[i] { @@ -82,19 +113,13 @@ outer: case 1: if zeroCount == 2 || zeroCount == 3 { - l := delimStart - start + l = delimStart - start - if l == 0 { - return nil, fmt.Errorf("invalid NALU") + if l != 0 { + ret[pos] = buf[start:delimStart] + pos++ } - if (auSize + l) > MaxAccessUnitSize { - return nil, fmt.Errorf("access unit size (%d) is too big, maximum is %d", auSize+l, MaxAccessUnitSize) - } - - ret[pos] = buf[start:delimStart] - pos++ - auSize += l start = i + 1 } zeroCount = 0 @@ -104,18 +129,12 @@ outer: } } - l := bl - start + l = bl - start - if l == 0 { - return nil, fmt.Errorf("invalid NALU") + if l != 0 { + ret[pos] = buf[start:bl] } - if (auSize + l) > MaxAccessUnitSize { - return nil, fmt.Errorf("access unit size (%d) is too big, maximum is %d", auSize+l, MaxAccessUnitSize) - } - - ret[pos] = buf[start:bl] - return ret, nil } diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/avcc.go b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/avcc.go index 06220e9..9c799c2 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/avcc.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/avcc.go @@ -13,8 +13,7 @@ var ErrAVCCNoNALUs = errors.New("AVCC unit doesn't contain any NALU") func AVCCUnmarshal(buf []byte) ([][]byte, error) { bl := len(buf) pos := 0 - var ret [][]byte - naluCount := 0 + n := 0 auSize := 0 for { @@ -30,18 +29,12 @@ func AVCCUnmarshal(buf []byte) ([][]byte, error) { return nil, fmt.Errorf("access unit size (%d) is too big, maximum is %d", auSize+l, MaxAccessUnitSize) } - if (naluCount + 1) > MaxNALUsPerAccessUnit { - return nil, fmt.Errorf("NALU count (%d) exceeds maximum allowed (%d)", - len(ret)+1, MaxNALUsPerAccessUnit) - } - if (bl - pos) < l { return nil, fmt.Errorf("invalid length") } - ret = append(ret, buf[pos:pos+l]) auSize += l - naluCount++ + n++ pos += l } @@ -50,10 +43,29 @@ func AVCCUnmarshal(buf []byte) ([][]byte, error) { } } - if ret == nil { + if n == 0 { return nil, ErrAVCCNoNALUs } + if n > MaxNALUsPerAccessUnit { + return nil, fmt.Errorf("NALU count (%d) exceeds maximum allowed (%d)", + n, MaxNALUsPerAccessUnit) + } + + ret := make([][]byte, n) + pos = 0 + + for i := 0; i < n; { + l := int(uint32(buf[pos])<<24 | uint32(buf[pos+1])<<16 | uint32(buf[pos+2])<<8 | uint32(buf[pos+3])) + pos += 4 + + if l != 0 { + ret[i] = buf[pos : pos+l] + pos += l + i++ + } + } + return ret, nil } diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/dts_extractor.go b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/dts_extractor.go index 82e04a6..657f99d 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/dts_extractor.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h264/dts_extractor.go @@ -19,7 +19,7 @@ const ( maxBytesToGetPOC = 22 ) -func getPictureOrderCount(buf []byte, sps *SPS) (uint32, error) { +func getPictureOrderCount(buf []byte, sps *SPS, idr bool) (uint32, error) { buf = buf[1:] lb := len(buf) @@ -50,6 +50,13 @@ func getPictureOrderCount(buf []byte, sps *SPS) (uint32, error) { return 0, err } + if idr { + _, err = bits.ReadGolombUnsigned(buf, &pos) // idr_pic_id + if err != nil { + return 0, err + } + } + picOrderCntLsb, err := bits.ReadBits(buf, &pos, int(sps.Log2MaxPicOrderCntLsbMinus4+4)) if err != nil { return 0, err @@ -89,9 +96,17 @@ func NewDTSExtractor() *DTSExtractor { func (d *DTSExtractor) extractInner(au [][]byte, pts time.Duration) (time.Duration, bool, error) { var idr []byte var nonIDR []byte + // a value of 00 indicates that the content of the NAL unit is not + // used to reconstruct reference pictures for inter picture + // prediction. Such NAL units can be discarded without risking + // the integrity of the reference pictures. Values greater than + // 00 indicate that the decoding of the NAL unit is required to + // maintain the integrity of the reference pictures. + nonZeroNalRefIDFound := false for _, nalu := range au { typ := NALUType(nalu[0] & 0x1F) + nonZeroNalRefIDFound = nonZeroNalRefIDFound || ((nalu[0] & 0x60) > 0) switch typ { case NALUTypeSPS: if !bytes.Equal(d.sps, nalu) { @@ -128,11 +143,17 @@ func (d *DTSExtractor) extractInner(au [][]byte, pts time.Duration) (time.Durati return 0, false, fmt.Errorf("pic_order_cnt_type = 1 is not supported yet") } + // Implicit processing of PicOrderCountType 0 switch { case idr != nil: - d.expectedPOC = 0 d.pauseDTS = 0 + var err error + d.expectedPOC, err = getPictureOrderCount(idr, d.spsp, true) + if err != nil { + return 0, false, err + } + if !d.prevDTSFilled || d.reorderedFrames == 0 { return pts, false, nil } @@ -148,7 +169,7 @@ func (d *DTSExtractor) extractInner(au [][]byte, pts time.Duration) (time.Durati return d.prevDTS + 1*time.Millisecond, true, nil } - poc, err := getPictureOrderCount(nonIDR, d.spsp) + poc, err := getPictureOrderCount(nonIDR, d.spsp, false) if err != nil { return 0, false, err } @@ -190,6 +211,9 @@ func (d *DTSExtractor) extractInner(au [][]byte, pts time.Duration) (time.Durati return d.prevDTS + (pts-d.prevDTS)/time.Duration(pocDiff+d.reorderedFrames+1), false, nil + case !nonZeroNalRefIDFound: + return d.prevDTS, false, nil + default: return 0, false, fmt.Errorf("access unit doesn't contain an IDR or non-IDR NALU") } diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h265/sps.go b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h265/sps.go index 2968f47..006fcd9 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h265/sps.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/h265/sps.go @@ -27,6 +27,64 @@ var subHeightC = []uint32{ 1, } +func min(a, b int) int { + if a < b { + return a + } + return b +} + +// SPS_ScalingListData is a scaling list data. +type SPS_ScalingListData struct { //nolint:revive + ScalingListPredModeFlag [4][6]bool + ScalingListPredmatrixIDDelta [4][6]uint32 + ScalingListDcCoefMinus8 [4][6]int32 +} + +func (d *SPS_ScalingListData) unmarshal(buf []byte, pos *int) error { + for sizeID := 0; sizeID < 4; sizeID++ { + var matrixIDIncr int + if sizeID == 3 { + matrixIDIncr = 3 + } else { + matrixIDIncr = 1 + } + + for matrixID := 0; matrixID < 6; matrixID += matrixIDIncr { + var err error + d.ScalingListPredModeFlag[sizeID][matrixID], err = bits.ReadFlag(buf, pos) + if err != nil { + return err + } + + if !d.ScalingListPredModeFlag[sizeID][matrixID] { + d.ScalingListPredmatrixIDDelta[sizeID][matrixID], err = bits.ReadGolombUnsigned(buf, pos) + if err != nil { + return err + } + } else { + coefNum := min(64, 1<<(4+(sizeID<<1))) + + if sizeID > 1 { + d.ScalingListDcCoefMinus8[sizeID-2][matrixID], err = bits.ReadGolombSigned(buf, pos) + if err != nil { + return err + } + } + + for i := 0; i < coefNum; i++ { + _, err = bits.ReadGolombSigned(buf, pos) // scalingListDeltaCoef + if err != nil { + return err + } + } + } + } + } + + return nil +} + // SPS_DefaultDisplayWindow is a default display window. type SPS_DefaultDisplayWindow struct { //nolint:revive LeftOffset uint32 @@ -626,7 +684,7 @@ type SPS struct { MaxTransformHierarchyDepthInter uint32 MaxTransformHierarchyDepthIntra uint32 ScalingListEnabledFlag bool - ScalingListDataPresentFlag bool + ScalingListData *SPS_ScalingListData AmpEnabledFlag bool SampleAdaptiveOffsetEnabledFlag bool PcmEnabledFlag bool @@ -683,6 +741,11 @@ func (s *SPS) Unmarshal(buf []byte) error { return err } + // this prevents a panic in Marshal() + if s.ChromaFormatIdc > 3 { + return fmt.Errorf("invalid chroma_format_idc") + } + if s.ChromaFormatIdc == 3 { s.SeparateColourPlaneFlag, err = bits.ReadFlag(buf, &pos) if err != nil { @@ -799,13 +862,18 @@ func (s *SPS) Unmarshal(buf []byte) error { } if s.ScalingListEnabledFlag { - s.ScalingListDataPresentFlag, err = bits.ReadFlag(buf, &pos) + var scalingListDataPresentFlag bool + scalingListDataPresentFlag, err = bits.ReadFlag(buf, &pos) if err != nil { return err } - if s.ScalingListDataPresentFlag { - return fmt.Errorf("ScalingListDataPresentFlag not supported yet") + if scalingListDataPresentFlag { + s.ScalingListData = &SPS_ScalingListData{} + err = s.ScalingListData.unmarshal(buf, &pos) + if err != nil { + return err + } } } diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/adts.go b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/adts.go index dfb5dd3..499bf2c 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/adts.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/adts.go @@ -4,7 +4,7 @@ import ( "fmt" ) -// ADTSPacket is an ADTS frame. +// ADTSPacket is an ADTS packet. // Specification: ISO 14496-3, Table 1.A.5 type ADTSPacket struct { Type ObjectType @@ -13,7 +13,7 @@ type ADTSPacket struct { AU []byte } -// ADTSPackets is a group od ADTS packets. +// ADTSPackets is a group of ADTS packets. type ADTSPackets []*ADTSPacket // Unmarshal decodes an ADTS stream into ADTS packets. diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/stream_mux_config.go b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/stream_mux_config.go index 73c8c95..87508d9 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/stream_mux_config.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio/stream_mux_config.go @@ -96,6 +96,8 @@ func (c *StreamMuxConfig) Unmarshal(buf []byte) error { if err != nil { // support truncated configs l.LatmBufferFullness = 255 + c.Programs = c.Programs[:prog+1] + p.Layers = p.Layers[:lay+1] return nil //nolint:nilerr } l.FrameLengthType = uint(tmp) diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/fmp4.go b/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/fmp4.go index 1fe83d0..a18cb07 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/fmp4.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/fmp4.go @@ -1,2 +1,6 @@ // Package fmp4 contains a fragmented-MP4 reader and writer. package fmp4 + +const ( + maxSamplesPerTrun = 120 * 160 // 120fps * 60 seconds +) diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/parts.go b/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/parts.go index 4313b07..a28cf3f 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/parts.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/formats/fmp4/parts.go @@ -110,6 +110,15 @@ func (ps *Parts) Unmarshal(byts []byte) error { return nil, fmt.Errorf("unexpected trun") } + // prevent RAM exhaustion due to unlimited Trun unmarshaling + rawBox := byts[h.BoxInfo.Offset:] + if len(rawBox) >= 16 { + sampleCount := uint32(rawBox[12])<<24 | uint32(rawBox[13])<<16 | uint32(rawBox[14])<<8 | uint32(rawBox[15]) + if sampleCount > maxSamplesPerTrun { + return nil, fmt.Errorf("sample count (%d) exceeds maximum (%d)", sampleCount, maxSamplesPerTrun) + } + } + box, _, err := h.ReadPayload() if err != nil { return nil, err diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/codec_unsupported.go b/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/codec_unsupported.go new file mode 100644 index 0000000..c752a8e --- /dev/null +++ b/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/codec_unsupported.go @@ -0,0 +1,19 @@ +package mpegts + +import ( + "github.com/asticode/go-astits" +) + +// CodecUnsupported is an unsupported codec. +type CodecUnsupported struct{} + +// IsVideo implements Codec. +func (CodecUnsupported) IsVideo() bool { + return false +} + +func (*CodecUnsupported) isCodec() {} + +func (c CodecUnsupported) marshal(uint16) (*astits.PMTElementaryStream, error) { + panic("this should not happen") +} diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/reader.go b/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/reader.go index 2c70a21..d9b67d4 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/reader.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/reader.go @@ -78,19 +78,12 @@ func NewReader(br io.Reader) (*Reader, error) { var track Track err := track.unmarshal(dem, es) if err != nil { - if errors.Is(err, errUnsupportedCodec) { - continue - } return nil, err } tracks = append(tracks, &track) } - if tracks == nil { - return nil, fmt.Errorf("no tracks with supported codecs found") - } - // rewind demuxer dem = astits.NewDemuxer( context.Background(), diff --git a/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/track.go b/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/track.go index 7d0b481..3a15308 100644 --- a/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/track.go +++ b/vendor/github.com/bluenviron/mediacommon/pkg/formats/mpegts/track.go @@ -1,7 +1,6 @@ package mpegts import ( - "errors" "fmt" "github.com/asticode/go-astits" @@ -15,8 +14,6 @@ const ( opusIdentifier = 'O'<<24 | 'p'<<16 | 'u'<<8 | 's' ) -var errUnsupportedCodec = errors.New("unsupported codec") - func findMPEG4AudioConfig(dem *astits.Demuxer, pid uint16) (*mpeg4audio.Config, error) { for { data, err := dem.NextData() @@ -125,19 +122,15 @@ func (t *Track) unmarshal(dem *astits.Demuxer, es *astits.PMTElementaryStream) e switch es.StreamType { case astits.StreamTypeH265Video: t.Codec = &CodecH265{} - return nil case astits.StreamTypeH264Video: t.Codec = &CodecH264{} - return nil case astits.StreamTypeMPEG4Video: t.Codec = &CodecMPEG4Video{} - return nil case astits.StreamTypeMPEG2Video, astits.StreamTypeMPEG1Video: t.Codec = &CodecMPEG1Video{} - return nil case astits.StreamTypeAACAudio: conf, err := findMPEG4AudioConfig(dem, es.ElementaryPID) @@ -148,11 +141,9 @@ func (t *Track) unmarshal(dem *astits.Demuxer, es *astits.PMTElementaryStream) e t.Codec = &CodecMPEG4Audio{ Config: *conf, } - return nil case astits.StreamTypeMPEG1Audio: t.Codec = &CodecMPEG1Audio{} - return nil case astits.StreamTypeAC3Audio: sampleRate, channelCount, err := findAC3Parameters(dem, es.ElementaryPID) @@ -164,15 +155,18 @@ func (t *Track) unmarshal(dem *astits.Demuxer, es *astits.PMTElementaryStream) e SampleRate: sampleRate, ChannelCount: channelCount, } - return nil case astits.StreamTypePrivateData: codec := findOpusCodec(es.ElementaryStreamDescriptors) if codec != nil { t.Codec = codec - return nil + } else { + t.Codec = &CodecUnsupported{} } + + default: + t.Codec = &CodecUnsupported{} } - return errUnsupportedCodec + return nil } diff --git a/vendor/modules.txt b/vendor/modules.txt index 4654b66..9d479ce 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9,7 +9,7 @@ github.com/asticode/go-astikit # github.com/asticode/go-astits v1.13.0 ## explicit; go 1.13 github.com/asticode/go-astits -# github.com/bluenviron/mediacommon v1.11.1-0.20240525122142-20163863aa75 +# github.com/bluenviron/mediacommon v1.12.4 ## explicit; go 1.20 github.com/bluenviron/mediacommon/pkg/bits github.com/bluenviron/mediacommon/pkg/codecs/ac3