Conflicts:
	src/driver/fb_accel_sti.cpp
	src/gui/audioplayer.cpp
	src/gui/epgview.cpp


Origin commit data
------------------
Branch: ni/coolstream
Commit: b3319a4561
Author: vanhofen <vanhofen@gmx.de>
Date: 2017-09-26 (Tue, 26 Sep 2017)



------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2017-09-26 16:01:46 +02:00
9 changed files with 30 additions and 26 deletions

View File

@@ -2,16 +2,16 @@
#include <stdio.h> /* for perror */ #include <stdio.h> /* for perror */
#include <time.h> #include <time.h>
time_t time_monotonic_ms(void) int64_t time_monotonic_ms(void)
{ {
struct timespec t; struct timespec t;
time_t ret; int64_t ret;
if (clock_gettime(CLOCK_MONOTONIC, &t)) if (clock_gettime(CLOCK_MONOTONIC, &t))
{ {
perror("time_monotonic_ms clock_gettime"); perror("time_monotonic_ms clock_gettime");
return -1; return -1;
} }
ret = ((t.tv_sec + 604800)& 0x01FFFFF) * 1000; /* avoid overflow */ ret = (t.tv_sec + 604800) * (int64_t)1000; /* avoid overflow */
ret += t.tv_nsec / 1000000; ret += t.tv_nsec / 1000000;
return ret; return ret;
} }

View File

@@ -6,8 +6,8 @@
extern "C" extern "C"
{ {
#endif #endif
extern time_t time_monotonic_ms(void); time_t time_monotonic(void);
extern time_t time_monotonic(void); int64_t time_monotonic_ms(void);
uint64_t time_monotonic_us(void); uint64_t time_monotonic_us(void);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@@ -31,6 +31,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <inttypes.h>
#include <glfb.h> #include <glfb.h>
extern GLFramebuffer *glfb; extern GLFramebuffer *glfb;
@@ -115,18 +116,18 @@ void CFbAccelGLFB::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32
void CFbAccelGLFB::run() void CFbAccelGLFB::run()
{ {
printf(LOGTAG "run start\n"); printf(LOGTAG "run start\n");
time_t last_blit = 0; int64_t last_blit = 0;
blit_pending = false; blit_pending = false;
blit_thread = true; blit_thread = true;
blit_mutex.lock(); blit_mutex.lock();
set_threadname("glfb::autoblit"); set_threadname("glfb::autoblit");
while (blit_thread) { while (blit_thread) {
blit_cond.wait(&blit_mutex, blit_pending ? BLIT_INTERVAL_MIN : BLIT_INTERVAL_MAX); blit_cond.wait(&blit_mutex, blit_pending ? BLIT_INTERVAL_MIN : BLIT_INTERVAL_MAX);
time_t now = time_monotonic_ms(); int64_t now = time_monotonic_ms();
if (now - last_blit < BLIT_INTERVAL_MIN) if (now - last_blit < BLIT_INTERVAL_MIN)
{ {
blit_pending = true; blit_pending = true;
//printf(LOGTAG "run: skipped, time %ld\n", now - last_blit); //printf(LOGTAG "run: skipped, time %" PRId64 "\n", now - last_blit);
} }
else else
{ {

View File

@@ -38,6 +38,7 @@
#include <limits.h> #include <limits.h>
#include <errno.h> #include <errno.h>
#include <inttypes.h>
#include <linux/kd.h> #include <linux/kd.h>
#include <stdlib.h> #include <stdlib.h>
@@ -331,7 +332,7 @@ void CFbAccelSTi::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32_
void CFbAccelSTi::run() void CFbAccelSTi::run()
{ {
printf(LOGTAG "::run start\n"); printf(LOGTAG "::run start\n");
time_t last_blit = 0; int64_t last_blit = 0;
blit_pending = false; blit_pending = false;
blit_thread = true; blit_thread = true;
set_threadname("stifb::autoblit"); set_threadname("stifb::autoblit");
@@ -340,11 +341,12 @@ void CFbAccelSTi::run()
blit_cond.wait(&blit_mutex, blit_pending ? BLIT_INTERVAL_MIN : BLIT_INTERVAL_MAX); blit_cond.wait(&blit_mutex, blit_pending ? BLIT_INTERVAL_MIN : BLIT_INTERVAL_MAX);
blit_mutex.unlock(); blit_mutex.unlock();
time_t now = time_monotonic_ms(); int64_t now = time_monotonic_ms();
if (now - last_blit < BLIT_INTERVAL_MIN) int64_t diff = now - last_blit;
if (diff < BLIT_INTERVAL_MIN)
{ {
blit_pending = true; blit_pending = true;
//printf(LOGTAG "::run: skipped, time %ld\n", now - last_blit); //printf(LOGTAG "::run: skipped, time %" PRId64 "\n", diff);
} }
else else
{ {
@@ -372,9 +374,9 @@ void CFbAccelSTi::blit()
void CFbAccelSTi::_blit() void CFbAccelSTi::_blit()
{ {
#if 0 #if 0
static time_t last = 0; static int64_t last = 0;
time_t now = time_monotonic_ms(); int64_t now = time_monotonic_ms();
printf("%s %ld\n", __func__, now - last); printf("%s %" PRId64 "\n", __func__, now - last);
last = now; last = now;
#endif #endif
OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex); OpenThreads::ScopedLock<OpenThreads::Mutex> m_lock(mutex);

View File

@@ -486,12 +486,12 @@ void *insertEventsfromFile(void * data)
std::string epg_dir = (char *) data; std::string epg_dir = (char *) data;
indexname = epg_dir + "index.xml"; indexname = epg_dir + "index.xml";
time_t now = time_monotonic_ms(); int64_t now = time_monotonic_ms();
xmlDocPtr index_parser = parseXmlFile(indexname.c_str()); xmlDocPtr index_parser = parseXmlFile(indexname.c_str());
if (index_parser == NULL) { if (index_parser == NULL) {
readEventsFromDir(epg_dir, ev_count); readEventsFromDir(epg_dir, ev_count);
printf("[sectionsd] Reading Information finished after %ld milliseconds (%d events)\n", printf("[sectionsd] Reading Information finished after %" PRId64 " milliseconds (%d events)\n",
time_monotonic_ms()-now, ev_count); time_monotonic_ms()-now, ev_count);
reader_ready = true; reader_ready = true;
pthread_exit(NULL); pthread_exit(NULL);
@@ -515,7 +515,7 @@ void *insertEventsfromFile(void * data)
xmlFreeDoc(index_parser); xmlFreeDoc(index_parser);
printdate_ms(stdout); printdate_ms(stdout);
printf("[sectionsd] Reading Information finished after %ld milliseconds (%d events)\n", printf("[sectionsd] Reading Information finished after %" PRId64 " milliseconds (%d events)\n",
time_monotonic_ms()-now, ev_count); time_monotonic_ms()-now, ev_count);
reader_ready = true; reader_ready = true;

View File

@@ -1306,7 +1306,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start
} }
break; break;
} }
case CRCInput::RC_help: case CRCInput::RC_info:
bigFonts = bigFonts ? false : true; bigFonts = bigFonts ? false : true;
ResetModules(); ResetModules();
frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy); frameBuffer->paintBackgroundBoxRel(sx, sy, ox, oy);

View File

@@ -142,7 +142,7 @@ class CMoviePlayerGui : public CMenuTarget
unsigned short sub_supported[MAX_PLAYBACK_PIDS]; unsigned short sub_supported[MAX_PLAYBACK_PIDS];
int currentspid; int currentspid;
int min_x, min_y, max_x, max_y; int min_x, min_y, max_x, max_y;
time_t end_time; int64_t end_time;
bool ext_subs; bool ext_subs;
bool lock_subs; bool lock_subs;
uint64_t last_read; uint64_t last_read;

View File

@@ -133,14 +133,14 @@ void CShellWindow::exec()
fds.events = POLLIN | POLLHUP | POLLERR; fds.events = POLLIN | POLLHUP | POLLERR;
fcntl(fds.fd, F_SETFL, fcntl(fds.fd, F_GETFL, 0) | O_NONBLOCK); fcntl(fds.fd, F_SETFL, fcntl(fds.fd, F_GETFL, 0) | O_NONBLOCK);
time_t lastPaint = time_monotonic_ms(); int64_t lastPaint = time_monotonic_ms();
bool ok = true, nlseen = false, dirty = false, incomplete = false; bool ok = true, nlseen = false, dirty = false, incomplete = false;
char output[1024]; char output[1024];
std::string txt = ""; std::string txt = "";
std::string line = ""; std::string line = "";
do { do {
time_t now; int64_t now;
fds.revents = 0; fds.revents = 0;
int r = poll(&fds, 1, 300); int r = poll(&fds, 1, 300);
if (r > 0) { if (r > 0) {

View File

@@ -128,15 +128,16 @@ static const struct dtv_property dvbt_cmdargs[] = {
#define diff(x,y) (max(x,y) - min(x,y)) #define diff(x,y) (max(x,y) - min(x,y))
#define FE_TIMER_INIT() \ #define FE_TIMER_INIT() \
unsigned int timer_start; \ int64_t timer_start; \
static unsigned int tmin = 2000, tmax = 0; \ static uint32_t tmin = 2000, tmax = 0; \
unsigned int timer_msec = 0; uint32_t timer_msec = 0;
#define FE_TIMER_START() \ #define FE_TIMER_START() \
timer_start = time_monotonic_ms(); timer_start = time_monotonic_ms();
#define FE_TIMER_STOP(label) \ #define FE_TIMER_STOP(label) \
timer_msec = time_monotonic_ms() - timer_start; \ timer_msec = (uint32_t)(time_monotonic_ms() - \
timer_start); \
if(tmin > timer_msec) tmin = timer_msec; \ if(tmin > timer_msec) tmin = timer_msec; \
if(tmax < timer_msec) tmax = timer_msec; \ if(tmax < timer_msec) tmax = timer_msec; \
printf("[fe%d] %s: %u msec (min %u max %u)\n", \ printf("[fe%d] %s: %u msec (min %u max %u)\n", \