frameheader: Refactoring

This commit is contained in:
Hajime Hoshi 2017-11-19 04:18:35 +09:00
parent 632c7441e0
commit e72e3b6ecf
2 changed files with 5 additions and 4 deletions

View file

@ -61,9 +61,10 @@ const (
type SamplingFrequency int
const (
SamplingFrequency44100 = 0
SamplingFrequency48000 = 1
SamplingFrequency32000 = 2
SamplingFrequency44100 SamplingFrequency = 0
SamplingFrequency48000 SamplingFrequency = 1
SamplingFrequency32000 SamplingFrequency = 2
SamplingFrequencyReserved SamplingFrequency = 3
)
func (s SamplingFrequency) Int() int {

View file

@ -113,7 +113,7 @@ func (f FrameHeader) IsValid() bool {
if f.BitrateIndex() == 15 {
return false
}
if f.SamplingFrequency() == 3 {
if f.SamplingFrequency() == consts.SamplingFrequencyReserved {
return false
}
if f.Layer() == consts.LayerReserved {