aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_utils.h
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2016-04-26 09:49:08 +1200
committerMatthew Gregan <[email protected]>2016-04-26 09:49:08 +1200
commit6e2ac64d76d78597205170131d529bf00569af6d (patch)
tree8744c81c1ea21bcabcbf9afeccf537624b92846d /src/cubeb_utils.h
parentdbdfb3904deb7a0381588209cdd7388217d96e61 (diff)
downloadcubeb-6e2ac64d76d78597205170131d529bf00569af6d.tar.gz
cubeb-6e2ac64d76d78597205170131d529bf00569af6d.zip
wasapi: Up/down mix capture streams when stream formats don't match.
Diffstat (limited to 'src/cubeb_utils.h')
-rw-r--r--src/cubeb_utils.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cubeb_utils.h b/src/cubeb_utils.h
index 4d9290b..8c992ff 100644
--- a/src/cubeb_utils.h
+++ b/src/cubeb_utils.h
@@ -133,6 +133,20 @@ public:
length_ += length;
}
+ /** Prepend `length` zero-ed elements to the end of the array, resizing the
+ * array if needed.
+ * @parameter length the number of elements to prepend to the array.
+ */
+ void push_front_silence(size_t length)
+ {
+ if (length_ + length > capacity_) {
+ reserve(length + length_);
+ }
+ PodMove(data_ + length, data_, length_);
+ PodZero(data_, length);
+ length_ += length;
+ }
+
/** Return the number of free elements in the array. */
size_t available() const
{