diff --git a/Makefile b/Makefile index 95710ae..7c005c3 100644 --- a/Makefile +++ b/Makefile @@ -48,6 +48,7 @@ SRCS = \ omx_utils.c \ osd.c \ tiresias_pcfont.c \ + utils.c \ vcodec_omx.c \ vo_pi.c diff --git a/osd.c b/osd.c index e839cea..78af194 100644 --- a/osd.c +++ b/osd.c @@ -35,6 +35,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #include "channels.h" #include "events.h" #include "codec.h" +#include "utils.h" #define SCREEN 0 #define BG_LAYER 0 @@ -57,19 +58,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #define CHANNELLIST_UP 1 #define CHANNELLIST_DOWN 2 -double get_time(void) -{ - struct timeval tv; - - gettimeofday(&tv,NULL); - - double x = tv.tv_sec; - x *= 1000; - x += tv.tv_usec / 1000; - - return x; -} - static void utf8decode(char* str, char* r) { int x,y,z,ud; diff --git a/utils.c b/utils.c new file mode 100644 index 0000000..4854d19 --- /dev/null +++ b/utils.c @@ -0,0 +1,38 @@ +/* + +pidvbip - tvheadend client for the Raspberry Pi + +(C) Dave Chapman 2012-2013 + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#include +#include + +double get_time(void) +{ + struct timeval tv; + + gettimeofday(&tv,NULL); + + double x = tv.tv_sec; + x *= 1000; + x += tv.tv_usec / 1000; + + return x; +} + diff --git a/utils.h b/utils.h new file mode 100644 index 0000000..0f3e218 --- /dev/null +++ b/utils.h @@ -0,0 +1,28 @@ +/* + +pidvbip - tvheadend client for the Raspberry Pi + +(C) Dave Chapman 2012-2013 + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +#ifndef _UTILS_H +#define _UTILS_H + +double get_time(void); /* Get time of day in ms */ + +#endif