mirror of
https://github.com/game-stop/veejay.git
synced 2025-12-16 12:50:00 +01:00
Revert "use MONOTONIC instead of REALTIME"
This reverts commit b45457d858.
This commit is contained in:
@@ -58,7 +58,7 @@ static void net_delay(long ms, long sec )
|
|||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
ts.tv_sec = sec;
|
ts.tv_sec = sec;
|
||||||
ts.tv_nsec = MS_TO_NANO( ms );
|
ts.tv_nsec = MS_TO_NANO( ms );
|
||||||
clock_nanosleep( CLOCK_MONOTONIC,0, &ts, NULL );
|
clock_nanosleep( CLOCK_REALTIME,0, &ts, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int my_screen_id = -1;
|
static int my_screen_id = -1;
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ getDriver(int deviceID)
|
|||||||
if(drv->jackd_died && drv->client == 0)
|
if(drv->jackd_died && drv->client == 0)
|
||||||
{
|
{
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
clock_gettime( CLOCK_MONOTONIC, &now);
|
clock_gettime( CLOCK_REALTIME, &now);
|
||||||
|
|
||||||
/* wait 250ms before trying again */
|
/* wait 250ms before trying again */
|
||||||
if(TimeValDifference(&drv->last_reconnect_attempt, &now) >= 250)
|
if(TimeValDifference(&drv->last_reconnect_attempt, &now) >= 250)
|
||||||
@@ -424,7 +424,7 @@ JACK_callback(nframes_t nframes, void *arg)
|
|||||||
struct timespec tmp_tp;
|
struct timespec tmp_tp;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
clock_gettime(CLOCK_MONOTONIC, &tmp_tp );
|
clock_gettime(CLOCK_REALTIME, &tmp_tp );
|
||||||
|
|
||||||
__sync_lock_test_and_set( &(drv->previousTime.tv_sec), tmp_tp.tv_sec );
|
__sync_lock_test_and_set( &(drv->previousTime.tv_sec), tmp_tp.tv_sec );
|
||||||
__sync_lock_test_and_set( &(drv->previousTime.tv_nsec), tmp_tp.tv_nsec );
|
__sync_lock_test_and_set( &(drv->previousTime.tv_nsec), tmp_tp.tv_nsec );
|
||||||
@@ -1876,7 +1876,7 @@ JACK_GetPositionFromDriver(jack_driver_t * drv, enum pos_enum position,
|
|||||||
// type_str = "PLAYED";
|
// type_str = "PLAYED";
|
||||||
return_val = drv->played_client_bytes;
|
return_val = drv->played_client_bytes;
|
||||||
// gettimeofday(&now, 0);
|
// gettimeofday(&now, 0);
|
||||||
clock_gettime( CLOCK_MONOTONIC, &now );
|
clock_gettime( CLOCK_REALTIME, &now );
|
||||||
|
|
||||||
elapsedMS = TimeValDifference(&drv->previousTime, &now); /* find the elapsed milliseconds since last JACK_Callback() */
|
elapsedMS = TimeValDifference(&drv->previousTime, &now); /* find the elapsed milliseconds since last JACK_Callback() */
|
||||||
|
|
||||||
@@ -2066,7 +2066,7 @@ JACK_CleanupDriver(jack_driver_t * drv)
|
|||||||
drv->output_sample_rate_ratio = 1.0;
|
drv->output_sample_rate_ratio = 1.0;
|
||||||
drv->input_sample_rate_ratio = 1.0;
|
drv->input_sample_rate_ratio = 1.0;
|
||||||
drv->jackd_died = FALSE;
|
drv->jackd_died = FALSE;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &drv->previousTime); /* record the current time */
|
clock_gettime(CLOCK_REALTIME, &drv->previousTime); /* record the current time */
|
||||||
memcpy( &drv->last_reconnect_attempt, &drv->previousTime, sizeof(struct timespec));
|
memcpy( &drv->last_reconnect_attempt, &drv->previousTime, sizeof(struct timespec));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1112,7 +1112,7 @@ static void veejay_mjpeg_software_frame_sync(veejay_t * info,
|
|||||||
|
|
||||||
int usec_since_lastframe=0;
|
int usec_since_lastframe=0;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
clock_gettime( CLOCK_MONOTONIC, &now );
|
clock_gettime( CLOCK_REALTIME, &now );
|
||||||
|
|
||||||
usec_since_lastframe = (now.tv_nsec - settings->lastframe_completion.tv_nsec)/1000;
|
usec_since_lastframe = (now.tv_nsec - settings->lastframe_completion.tv_nsec)/1000;
|
||||||
|
|
||||||
@@ -1127,12 +1127,12 @@ static void veejay_mjpeg_software_frame_sync(veejay_t * info,
|
|||||||
|
|
||||||
nsecsleep.tv_nsec = (settings->usec_per_frame - usec_since_lastframe - 1000000 / HZ) * 1000;
|
nsecsleep.tv_nsec = (settings->usec_per_frame - usec_since_lastframe - 1000000 / HZ) * 1000;
|
||||||
nsecsleep.tv_sec = 0;
|
nsecsleep.tv_sec = 0;
|
||||||
clock_nanosleep(CLOCK_MONOTONIC,0, &nsecsleep, NULL);
|
clock_nanosleep(CLOCK_REALTIME,0, &nsecsleep, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
settings->first_frame = 0;
|
settings->first_frame = 0;
|
||||||
clock_gettime( CLOCK_MONOTONIC, &(settings->lastframe_completion) );
|
clock_gettime( CLOCK_REALTIME, &(settings->lastframe_completion) );
|
||||||
settings->syncinfo[settings->currently_processed_frame].timestamp = settings->lastframe_completion;
|
settings->syncinfo[settings->currently_processed_frame].timestamp = settings->lastframe_completion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2383,7 +2383,7 @@ static void veejay_playback_cycle(veejay_t * info)
|
|||||||
frame = bs.frame;
|
frame = bs.frame;
|
||||||
|
|
||||||
stats.nsync++;
|
stats.nsync++;
|
||||||
clock_gettime( CLOCK_MONOTONIC, &time_now);
|
clock_gettime( CLOCK_REALTIME, &time_now);
|
||||||
|
|
||||||
long d1 = (time_now.tv_sec * 1000000000) + time_now.tv_nsec;
|
long d1 = (time_now.tv_sec * 1000000000) + time_now.tv_nsec;
|
||||||
long n1 = (bs.timestamp.tv_sec * 1000000000) + bs.timestamp.tv_nsec;
|
long n1 = (bs.timestamp.tv_sec * 1000000000) + bs.timestamp.tv_nsec;
|
||||||
|
|||||||
@@ -933,7 +933,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
while( 1 ) { //@ until your PC stops working
|
while( 1 ) { //@ until your PC stops working
|
||||||
|
|
||||||
clock_nanosleep( CLOCK_MONOTONIC, 0, &req, NULL );
|
clock_nanosleep( CLOCK_REALTIME, 0, &req, NULL );
|
||||||
|
|
||||||
current_state = veejay_get_state(info);
|
current_state = veejay_get_state(info);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user