From 59af05730d45e1e074c5fa33aaea39fe0621c469 Mon Sep 17 00:00:00 2001 From: nareix Date: Thu, 9 Jun 2016 09:42:28 +0800 Subject: [PATCH] make IsCodecSupported global --- muxer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/muxer.go b/muxer.go index 7cda260..c6ab707 100644 --- a/muxer.go +++ b/muxer.go @@ -26,7 +26,7 @@ type Muxer struct { mdatWriter *atom.Writer } -func (self *Muxer) IsCodecSupported(codec av.CodecData) bool { +func IsCodecSupported(codec av.CodecData) bool { switch codec.Type() { case av.H264, av.AAC: return true @@ -36,7 +36,7 @@ func (self *Muxer) IsCodecSupported(codec av.CodecData) bool { } 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()) return }