spark: implement cRecord::GetStatus()

This commit is contained in:
Stefan Seyfried
2015-02-22 22:23:59 +01:00
parent 1df6cfc16d
commit 3b6333cc59

View File

@@ -51,6 +51,7 @@ public:
file_fd = -1; file_fd = -1;
exit_flag = RECORD_STOPPED; exit_flag = RECORD_STOPPED;
dmx_num = num; dmx_num = num;
state = REC_STATUS_OK;
} }
int file_fd; int file_fd;
int dmx_num; int dmx_num;
@@ -270,6 +271,7 @@ void RecData::RecordThread()
{ {
lt_info("%s: read failed: %m\n", __func__); lt_info("%s: read failed: %m\n", __func__);
exit_flag = RECORD_FAILED_READ; exit_flag = RECORD_FAILED_READ;
state = REC_STATUS_OVERFLOW;
break; break;
} }
} }
@@ -286,6 +288,7 @@ void RecData::RecordThread()
overflow = true; overflow = true;
if (!(overflow_count % 10)) if (!(overflow_count % 10))
lt_info("%s: buffer full! Overflow? (%d)\n", __func__, ++overflow_count); lt_info("%s: buffer full! Overflow? (%d)\n", __func__, ++overflow_count);
state = REC_STATUS_SLOW;
} }
r = aio_error(&a); r = aio_error(&a);
if (r == EINPROGRESS) if (r == EINPROGRESS)
@@ -369,8 +372,9 @@ void RecData::RecordThread()
int cRecord::GetStatus() int cRecord::GetStatus()
{ {
/* dummy for now */ if (pd)
return REC_STATUS_OK; return pd->state;
return REC_STATUS_OK; /* should not happen */
} }
void cRecord::ResetStatus() void cRecord::ResetStatus()