mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 13:48:42 -05:00
Summary: Provides more accurate playback timing.
timestamp should be accurate to +-1ms now. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@121 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
a288430e28
commit
54c7e67580
@ -329,14 +329,18 @@ int playback_callback(alsa_driver_t *alsa_driver_playback) {
|
||||
int nsec;
|
||||
int i,n;
|
||||
static int ic;
|
||||
snd_pcm_sframes_t delay;
|
||||
static short int n2;
|
||||
int16_t b0[2048];
|
||||
|
||||
// printf("playback callback\n");
|
||||
snd_pcm_delay(this->audio_fd, &delay);
|
||||
gettimeofday(&tv, NULL);
|
||||
stime = (double) tv.tv_sec + ((double)tv.tv_usec / 1000000.0) +
|
||||
*(this->ndsec) * 0.1;
|
||||
stime = stime + ((double)delay / (double)(this->output_sample_rate));
|
||||
*(this->Tsec) = stime;
|
||||
//printf("PLAY:TIME, %lf, %ld, %ld, %d\n", stime, delay, this->output_sample_rate, *this->ndsec);
|
||||
if(!(this->tx_starting) && (*(this->tx_ok)) ) {
|
||||
nsec = (int)stime;
|
||||
n = nsec / *(this->tr_period);
|
||||
|
Loading…
Reference in New Issue
Block a user