Fix review comments for earlier CL
Change-Id: Ia4a637f5d46f8ef0d7d5cefb953565c091c79df3
diff --git a/audio_utils/fifo.cpp b/audio_utils/fifo.cpp
index ec71d5f..958bbfb 100644
--- a/audio_utils/fifo.cpp
+++ b/audio_utils/fifo.cpp
@@ -196,12 +196,16 @@
audio_utils_fifo_provider(), mFifo(fifo), mLocalFront(0), mSharedFront(0)
{
if (throttlesWriter) {
+ ALOG_ASSERT(fifo.mThrottleFront == NULL);
fifo.mThrottleFront = &mSharedFront;
}
}
audio_utils_fifo_reader::~audio_utils_fifo_reader()
{
+ if (mFifo.mThrottleFront == &mSharedFront) {
+ mFifo.mThrottleFront = NULL;
+ }
}
ssize_t audio_utils_fifo_reader::read(void *buffer, size_t count, size_t *lost)
diff --git a/audio_utils/include/audio_utils/fifo.h b/audio_utils/include/audio_utils/fifo.h
index f12e3f2..56d7bbb 100644
--- a/audio_utils/include/audio_utils/fifo.h
+++ b/audio_utils/include/audio_utils/fifo.h
@@ -143,7 +143,7 @@
*
* The actual transfer count may be zero if the FIFO is full,
* or partial if the FIFO was almost full.
- * A negative return value indicates an error. Currently there are no errors defined.
+ * A negative return value indicates an error.
*/
ssize_t write(const void *buffer, size_t count);
@@ -176,7 +176,7 @@
*
* The actual transfer count may be zero if the FIFO is empty,
* or partial if the FIFO was almost empty.
- * A negative return value indicates an error. Currently there are no errors defined.
+ * A negative return value indicates an error.
*/
ssize_t read(void *buffer, size_t count, size_t *lost = NULL);