mirror of
https://github.com/kerberos-io/joy4.git
synced 2025-12-24 13:57:59 +08:00
avconv: fix encoder find bug
This commit is contained in:
@@ -81,15 +81,17 @@ func (self *Demuxer) prepare() (err error) {
|
||||
}
|
||||
ok = true
|
||||
|
||||
var enctype av.CodecType
|
||||
for _, typ:= range supports {
|
||||
if typ.IsAudio() {
|
||||
if enc, _ = avutil.DefaultHandlers.NewAudioEncoder(typ); dec != nil {
|
||||
if enc, _ = avutil.DefaultHandlers.NewAudioEncoder(typ); enc != nil {
|
||||
enctype = typ
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if enc == nil {
|
||||
err = fmt.Errorf("avconv: convert %s failed", codec.Type())
|
||||
err = fmt.Errorf("avconv: convert %s->%s failed", codec.Type(), enctype)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user