make IsCodecSupported global

This commit is contained in:
nareix 2016-06-09 09:42:28 +08:00
parent 6a3c769980
commit 59af05730d

View File

@ -26,7 +26,7 @@ type Muxer struct {
mdatWriter *atom.Writer mdatWriter *atom.Writer
} }
func (self *Muxer) IsCodecSupported(codec av.CodecData) bool { func IsCodecSupported(codec av.CodecData) bool {
switch codec.Type() { switch codec.Type() {
case av.H264, av.AAC: case av.H264, av.AAC:
return true return true
@ -36,7 +36,7 @@ func (self *Muxer) IsCodecSupported(codec av.CodecData) bool {
} }
func (self *Muxer) NewStream(codec av.CodecData) (err error) { func (self *Muxer) NewStream(codec av.CodecData) (err error) {
if !self.IsCodecSupported(codec) { if !IsCodecSupported(codec) {
err = fmt.Errorf("codec type=%x is not supported", codec.Type()) err = fmt.Errorf("codec type=%x is not supported", codec.Type())
return return
} }