aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cubeb_opensl.cpp
diff options
context:
space:
mode:
authorMatthew Gregan <[email protected]>2024-08-15 20:09:59 +0100
committerMatthew Gregan <[email protected]>2024-08-15 20:09:59 +0100
commitf9bf0702bcd0839da95545e834c20ac51988cc7a (patch)
tree1325a544da5a203d0a104275e3b92d004edd0310 /src/cubeb_opensl.cpp
parente0980443d8d25a42fd74ccbbab992fe0deaedfd7 (diff)
downloadcubeb-opensl_asserts.tar.gz
cubeb-opensl_asserts.zip
opensl: Add extra asserts to help track down BMO 1913284.opensl_asserts
Diffstat (limited to 'src/cubeb_opensl.cpp')
-rw-r--r--src/cubeb_opensl.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cubeb_opensl.cpp b/src/cubeb_opensl.cpp
index b36147f..aad4d6f 100644
--- a/src/cubeb_opensl.cpp
+++ b/src/cubeb_opensl.cpp
@@ -1857,6 +1857,9 @@ opensl_stream_get_position(cubeb_stream * stm, uint64_t * position)
uint64_t samplerate = stm->user_output_rate;
uint32_t output_latency = stm->output_latency_ms;
+ XASSERT(stm->written >= 0);
+ XASSERT(stm->user_output_rate > 0);
+ XASSERT(stm->output_configured_rate > 0);
pthread_mutex_lock(&stm->mutex);
int64_t maximum_position = stm->written * (int64_t)stm->user_output_rate /
stm->output_configured_rate;