From: Long.inus Date: Sun, 15 Dec 2013 19:26:03 +0000 (+0900) Subject: tunerec: fix mrb_put remaining bytes calculation, include ctype.h X-Git-Url: http://git.osdn.net/view?p=rec10%2Frec10-git.git;a=commitdiff_plain;h=b2113915a2245bc8ee164571f3e34a3ecd4b08bc tunerec: fix mrb_put remaining bytes calculation, include ctype.h --- diff --git a/tunerec/tunerec.c b/tunerec/tunerec.c index d1ea2af..a30bfe9 100755 --- a/tunerec/tunerec.c +++ b/tunerec/tunerec.c @@ -15,6 +15,7 @@ #include #include #include +#include #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #ifndef DTV_STREAM_ID @@ -95,7 +96,7 @@ bool mrb_get(mrb* rb, char *target, size_t size) { // 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;