Skip to content

Update Makefile #76

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 12 commits into from
Prev Previous commit
Next Next commit
reduce phase shiift between subsequent tone buffers
  • Loading branch information
va7yaa committed Jan 17, 2017
commit 7685502c9bddfd8601ea7dea6e2a2aee5e59a033
4 changes: 2 additions & 2 deletions audio_ptt.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static void * ptt_thread (void *arg)
if (err == 0) {
short* pnData;
short sample;
int nSamples = save_audio_config_p->adev[a].samples_per_sec / 5;
int nSamples = (int)( ( (double)save_audio_config_p->adev[a].samples_per_sec / (double)freq ) * ceil( (double)freq / 5.0 ) );
int nBufferLength = save_audio_config_p->adev[a].num_channels * nSamples * sizeof(short);
int i;
int j;
Expand Down Expand Up @@ -198,7 +198,7 @@ static void * ptt_thread (void *arg)
int i;
int j;

nSamples = samples_per_sec / 5;
nSamples = (int)( ( (double)samples_per_sec / (double)freq ) * ceil( (double)freq / 5.0 ) );
nBufferLength = num_channels * nSamples * sizeof(short);
pnData = (short*)malloc (nBufferLength);

Expand Down
2 changes: 1 addition & 1 deletion config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
dw_printf ("Config file line %d: %s with RIG is only available when hamlib support is enabled.\n", line, otname);
#endif
}
else if (strcasecmp( t, "CHANNEL") == 0) {
else if (strcasecmp(t, "CHANNEL") == 0) {
t = split(NULL, 0);
if (t == NULL) {
text_color_set( DW_COLOR_ERROR );
Expand Down
14 changes: 8 additions & 6 deletions ptt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1138,15 +1138,17 @@ void ptt_term (void)
}

for (n = 0; n < MAX_CHANS; n++) {
if (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_method == PTT_METHOD_AUDIO) {
if (save_audio_config_p->achan[n].valid) {
if (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_method == PTT_METHOD_AUDIO) {
#ifdef __WIN32__
SetEvent (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_close) ;
SetEvent (save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_close) ;
#else
pthread_mutex_lock (&save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_mutex);
save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_state = PTT_AUDIO_STATE_CLOSE;
pthread_cond_signal (&save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_condition);
pthread_mutex_unlock (&save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_mutex);
pthread_mutex_lock (&save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_mutex);
save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_state = PTT_AUDIO_STATE_CLOSE;
pthread_cond_signal (&save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_condition);
pthread_mutex_unlock (&save_audio_config_p->achan[n].octrl[OCTYPE_PTT].ptt_mutex);
#endif
}
}
}

Expand Down