Add Decoder Registry

Add Raw Decoder
This commit is contained in:
Emmm Monster
2020-12-26 15:47:10 +08:00
parent 1aa5731225
commit d5031e1935
8 changed files with 123 additions and 11 deletions

View File

@ -48,7 +48,7 @@ func (d *Decoder) GetMeta() common.Meta {
return nil
}
func NewDecoder(data []byte) *Decoder {
func NewDecoder(data []byte) common.Decoder {
//todo: Notice the input data will be changed for now
return &Decoder{file: data}
}
@ -123,3 +123,8 @@ func padOrTruncate(raw string, length int) string {
}
return out
}
func init() {
// Kuwo Mp3/Flac
common.RegisterDecoder("kwm", NewDecoder)
}