mirror of https://bitbucket.org/ausocean/av.git
alsa: pass codec to ring buffer size calc
This commit is contained in:
parent
3e30e4846b
commit
35e602748d
|
@ -170,7 +170,7 @@ func (d *ALSA) Setup(c config.Config) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create ring buffer with appropriate chunk size.
|
// Create ring buffer with appropriate chunk size.
|
||||||
cs := pcm.DataSize(d.SampleRate, d.Channels, d.BitDepth, d.RecPeriod, 0)
|
cs := pcm.DataSize(d.SampleRate, d.Channels, d.BitDepth, d.RecPeriod, d.Codec)
|
||||||
d.rb = ring.NewBuffer(rbLen, cs, rbTimeout)
|
d.rb = ring.NewBuffer(rbLen, cs, rbTimeout)
|
||||||
|
|
||||||
// Start device in paused mode.
|
// Start device in paused mode.
|
||||||
|
|
Loading…
Reference in New Issue