aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-core
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-08-31 14:35:16 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-08-31 14:35:16 +0200
commit4c05fc3e4513ba3789dcc237493abcbe74d548e3 (patch)
treed4ecdf0edd2daad1da7e7e5ec779647ae2638e9e /nihav-core
parent8ea7e3064452b84ba3428de3c6f88b834a66b78c (diff)
downloadnihav-4c05fc3e4513ba3789dcc237493abcbe74d548e3.tar.gz
core: add allocation of 32-bit integer audio to alloc_audio_buffer()
Diffstat (limited to 'nihav-core')
-rw-r--r--nihav-core/src/frame.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs
index 80f1adf..9423b0e 100644
--- a/nihav-core/src/frame.rs
+++ b/nihav-core/src/frame.rs
@@ -661,6 +661,10 @@ pub fn alloc_audio_buffer(ainfo: NAAudioInfo, nsamples: usize, chmap: NAChannelM
let data: Vec<i16> = vec![0; length];
let buf: NAAudioBuffer<i16> = NAAudioBuffer { data: NABufferRef::new(data), info: ainfo, offs, chmap, len: nsamples, stride, step };
Ok(NABufferType::AudioI16(buf))
+ } else if ainfo.format.get_bits() == 32 && ainfo.format.is_signed() {
+ let data: Vec<i32> = vec![0; length];
+ let buf: NAAudioBuffer<i32> = NAAudioBuffer { data: NABufferRef::new(data), info: ainfo, offs, chmap, len: nsamples, stride, step };
+ Ok(NABufferType::AudioI32(buf))
} else {
Err(AllocatorError::TooLargeDimensions)
}