#include <pthread.h>
#include <stdbool.h>
#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#ifndef DTV_STREAM_ID
// RingBuffer underflow.
return false;
}
- if ( rb->rb_rt + size <= rb->rb_wt ) {
+ if ( rb->rb_rt + size <= RING_BUFFER_SIZE ) {
// read bytes + newly taken bytes <= buffer max size
memcpy(target, rb->rb_ptr + rb->rb_rt, size);
rb->rb_rt = rb->rb_rt + size;