aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_utils.h
diff options
context:
space:
mode:
authorPaul Adenot <[email protected]>2016-03-17 17:51:14 +0100
committerPaul Adenot <[email protected]>2016-03-18 12:10:05 +0100
commit144e86617d5e1bda3301b68dae62c9f5c0ce1828 (patch)
tree2be62e072a5bb907e6f1eae9ef9550ba02543251 /src/cubeb_utils.h
parent0c8754979e55aeba815ccdcce2b218e02aac4019 (diff)
downloadcubeb-144e86617d5e1bda3301b68dae62c9f5c0ce1828.tar.gz
cubeb-144e86617d5e1bda3301b68dae62c9f5c0ce1828.zip
Rework how draining happens.
It's now much closer than what was happening before, that was more correct. When getting back less frames than expected from the callback, we don't arbitrarily put silent frames at the end, and prefer to track the number of frames written in the buffer (like WASAPI does with its buffers, in a way).
Diffstat (limited to 'src/cubeb_utils.h')
-rw-r--r--src/cubeb_utils.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cubeb_utils.h b/src/cubeb_utils.h
index 4f881f1..15f8315 100644
--- a/src/cubeb_utils.h
+++ b/src/cubeb_utils.h
@@ -1,5 +1,5 @@
/*
- * Copyright � 2016 Mozilla Foundation
+ * Copyright © 2016 Mozilla Foundation
*
* This program is made available under an ISC-style license. See the
* accompanying file LICENSE for details.
@@ -160,6 +160,12 @@ public:
return true;
}
+ void set_length(size_t length)
+ {
+ assert(length <= capacity_);
+ length_ = length;
+ }
+
private:
/** The underlying storage */
T * data_;