mirror of
https://github.com/bluenviron/mediacommon.git
synced 2025-12-24 13:17:52 +08:00
bump golangci-lint (#203)
This commit is contained in:
@@ -144,13 +144,15 @@ func (c *SequenceHeader_ColorConfig) unmarshal(seqProfile uint8, buf []byte, pos
|
||||
return err
|
||||
}
|
||||
|
||||
switch {
|
||||
case seqProfile == 0:
|
||||
switch seqProfile {
|
||||
case 0:
|
||||
c.SubsamplingX = true
|
||||
c.SubsamplingY = true
|
||||
case seqProfile == 1:
|
||||
|
||||
case 1:
|
||||
c.SubsamplingX = false
|
||||
c.SubsamplingY = false
|
||||
|
||||
default:
|
||||
if c.BitDepth == 12 {
|
||||
c.SubsamplingX, err = bits.ReadFlag(buf, pos)
|
||||
|
||||
@@ -114,9 +114,11 @@ func getPTSDTSDiff(buf []byte, sps *SPS, pps *PPS) (uint32, error) {
|
||||
var v uint32
|
||||
|
||||
if sliceType == 0 { // B-frame
|
||||
if typ == NALUType_TRAIL_N || typ == NALUType_RASL_N {
|
||||
switch typ {
|
||||
case NALUType_TRAIL_N, NALUType_RASL_N:
|
||||
v = sps.MaxNumReorderPics[0] - uint32(len(rps.DeltaPocS1))
|
||||
} else if typ == NALUType_TRAIL_R || typ == NALUType_RASL_R {
|
||||
|
||||
case NALUType_TRAIL_R, NALUType_RASL_R:
|
||||
if len(rps.DeltaPocS0) == 0 {
|
||||
return 0, fmt.Errorf("invalid DeltaPocS0")
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func (m *DefineQuantizationTable) Unmarshal(buf []byte) error {
|
||||
precision := buf[0] >> 4
|
||||
buf = buf[1:]
|
||||
if precision != 0 {
|
||||
return fmt.Errorf("Precision %d is not supported", precision)
|
||||
return fmt.Errorf("precision %d is not supported", precision)
|
||||
}
|
||||
|
||||
if len(buf) < 64 {
|
||||
|
||||
@@ -103,7 +103,7 @@ func (ps *Parts) Unmarshal(byts []byte) error {
|
||||
}
|
||||
tfdt = box.(*amp4.Tfdt)
|
||||
|
||||
if tfdt.FullBox.Version != 1 {
|
||||
if tfdt.Version != 1 {
|
||||
return nil, fmt.Errorf("unsupported tfdt version")
|
||||
}
|
||||
|
||||
|
||||
@@ -211,9 +211,9 @@ func (w *Writer) WriteMPEG4Audio(
|
||||
|
||||
for i, au := range aus {
|
||||
pkts[i] = &mpeg4audio.ADTSPacket{
|
||||
Type: aacCodec.Config.Type,
|
||||
Type: aacCodec.Type,
|
||||
SampleRate: aacCodec.SampleRate,
|
||||
ChannelCount: aacCodec.Config.ChannelCount,
|
||||
ChannelCount: aacCodec.ChannelCount,
|
||||
AU: au,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user