projects
/
nihav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c19ce78
)
frame: treat single-channel audio as planar too if possible
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Wed, 5 Sep 2018 11:59:24 +0000
(13:59 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Wed, 5 Sep 2018 11:59:24 +0000
(13:59 +0200)
src/frame.rs
patch
|
blob
|
blame
|
history
diff --git
a/src/frame.rs
b/src/frame.rs
index 6f22dafc1cdcdc4277704789ad3fbed197f00249..628efb6eb75aff1606a5ea7097a85181b7831148 100644
(file)
--- a/
src/frame.rs
+++ b/
src/frame.rs
@@
-336,7
+336,7
@@
pub fn alloc_video_buffer(vinfo: NAVideoInfo, align: u8) -> Result<NABufferType,
pub fn alloc_audio_buffer(ainfo: NAAudioInfo, nsamples: usize, chmap: NAChannelMap) -> Result<NABufferType, AllocatorError> {
let mut offs: Vec<usize> = Vec::new();
- if ainfo.format.is_planar() {
+ if ainfo.format.is_planar()
|| (ainfo.channels == 1 && (ainfo.format.get_bits() % 8) == 0)
{
let len = nsamples.checked_mul(ainfo.channels as usize);
if len == None { return Err(AllocatorError::TooLargeDimensions); }
let length = len.unwrap();