summaryrefslogtreecommitdiff
path: root/src/buffer/common_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer/common_internal.h')
-rw-r--r--src/buffer/common_internal.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/buffer/common_internal.h b/src/buffer/common_internal.h
index a9e6ece..6685a3e 100644
--- a/src/buffer/common_internal.h
+++ b/src/buffer/common_internal.h
@@ -17,6 +17,17 @@ enum {
ERRORED
};
+//#define CAMU_BUFFER_SPORADIC_ERRORS
+#ifdef CAMU_BUFFER_SPORADIC_ERRORS
+#include <al/random.h>
+#define ROLL_FOR_BUFFER_ERROR(buf) do { \
+ if (al_random_int(0, 254) == 72) { \
+ log_warn("Random buffer error proc."); \
+ atomic_store(u32)(&(buf)->flow, FLUSHED_ERROR, AL_ATOMIC_RELAXED); \
+ } \
+} while (0)
+#endif
+
static inline bool frame_is_late(struct camu_clock *clock, f64 base, f64 pts, f64 duration)
{
return pts + duration < ((base == -1.0) ? camu_clock_get_base_pts(clock) : base);