Commit 3b0f342f authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

ts: use timezone and fix thread-safety

parent ae3c84e8
...@@ -3111,12 +3111,11 @@ static void EITCallBack( demux_t *p_demux, ...@@ -3111,12 +3111,11 @@ static void EITCallBack( demux_t *p_demux,
if( p_sys->i_tdt_delta == 0 ) if( p_sys->i_tdt_delta == 0 )
p_sys->i_tdt_delta = CLOCK_FREQ * (i_start + i_duration - 5) - mdate(); p_sys->i_tdt_delta = CLOCK_FREQ * (i_start + i_duration - 5) - mdate();
//i_start -= 9 * 60 * 60; // JST -> UTC i_tot_time = (mdate() + p_sys->i_tdt_delta) / CLOCK_FREQ;
time_t timer = time( NULL );
int64_t diff = difftime( mktime( localtime( &timer ) ), tzset(); // JST -> UTC
mktime( gmtime( &timer ) ) ); i_start += timezone; // FIXME: what about DST?
i_start -= diff; i_tot_time += timezone;
i_tot_time = (mdate() + p_sys->i_tdt_delta) / CLOCK_FREQ - diff;
if( p_evt->i_running_status == 0x00 && if( p_evt->i_running_status == 0x00 &&
(i_start - 5 < i_tot_time && (i_start - 5 < i_tot_time &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment