mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
Merge remote-tracking branch 'martiis-neutrino-mp/master'
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_RECORD, this, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_RECORD, this, args)
|
||||||
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_RECORD, this, args)
|
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_RECORD, this, args)
|
||||||
|
|
||||||
/* helper function to call the cpp thread loop */
|
/* helper functions to call the cpp thread loops */
|
||||||
void *execute_record_thread(void *c)
|
void *execute_record_thread(void *c)
|
||||||
{
|
{
|
||||||
cRecord *obj = (cRecord *)c;
|
cRecord *obj = (cRecord *)c;
|
||||||
@@ -183,11 +183,13 @@ void cRecord::RecordThread()
|
|||||||
prctl (PR_SET_NAME, (unsigned long)&threadname);
|
prctl (PR_SET_NAME, (unsigned long)&threadname);
|
||||||
int readsize = bufsize/16;
|
int readsize = bufsize/16;
|
||||||
int buf_pos = 0;
|
int buf_pos = 0;
|
||||||
|
int count = 0;
|
||||||
int queued = 0;
|
int queued = 0;
|
||||||
uint8_t *buf;
|
uint8_t *buf;
|
||||||
struct aiocb a;
|
struct aiocb a;
|
||||||
|
|
||||||
buf = (uint8_t *)malloc(bufsize);
|
buf = (uint8_t *)malloc(bufsize);
|
||||||
|
lt_info("BUFSIZE=0x%x READSIZE=0x%x\n", bufsize, readsize);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
{
|
{
|
||||||
exit_flag = RECORD_FAILED_MEMORY;
|
exit_flag = RECORD_FAILED_MEMORY;
|
||||||
@@ -222,8 +224,7 @@ void cRecord::RecordThread()
|
|||||||
if (toread > readsize)
|
if (toread > readsize)
|
||||||
toread = readsize;
|
toread = readsize;
|
||||||
ssize_t s = dmx->Read(buf + buf_pos, toread, 50);
|
ssize_t s = dmx->Read(buf + buf_pos, toread, 50);
|
||||||
lt_debug("%s: buf_pos %6d s %6d / %6d\n", __func__,
|
lt_debug("%s: buf_pos %6d s %6d / %6d\n", __func__, buf_pos, (int)s, bufsize - buf_pos);
|
||||||
buf_pos, (int)s, bufsize - buf_pos);
|
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
{
|
{
|
||||||
if (errno != EAGAIN && (errno != EOVERFLOW || !overflow))
|
if (errno != EAGAIN && (errno != EOVERFLOW || !overflow))
|
||||||
@@ -237,6 +238,15 @@ void cRecord::RecordThread()
|
|||||||
{
|
{
|
||||||
overflow = false;
|
overflow = false;
|
||||||
buf_pos += s;
|
buf_pos += s;
|
||||||
|
if (count > 100)
|
||||||
|
{
|
||||||
|
if (buf_pos < bufsize / 2)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user