exp/audio: fix inability to use mono 8 format
There is no way to distinguish an unknown format from Mono8 because Mono8 is zero. The current CL fixes this issue by starting the format constants from iota + 1. Change-Id: I8c709cdaff3bc46bcc15ab770cfcfd04c186034d Reviewed-on: https://go-review.googlesource.com/12386 Reviewed-by: Burcu Dogan <jbd@google.com>
This commit is contained in:
Родитель
e5bb9c1e6f
Коммит
a34303262d
|
@ -41,7 +41,7 @@ type ReadSeekCloser interface {
|
|||
type Format int
|
||||
|
||||
const (
|
||||
Mono8 Format = iota
|
||||
Mono8 Format = iota + 1
|
||||
Mono16
|
||||
Stereo8
|
||||
Stereo16
|
||||
|
@ -65,6 +65,7 @@ var formatCodes = [...]uint32{
|
|||
}
|
||||
|
||||
var formatStrings = [...]string{
|
||||
0: "unknown",
|
||||
Mono8: "mono8",
|
||||
Mono16: "mono16",
|
||||
Stereo8: "stereo8",
|
||||
|
|
Загрузка…
Ссылка в новой задаче