From 6189d47595f6e11d2fc4b144f11063b66dbaa9b3 Mon Sep 17 00:00:00 2001 From: Diane Bruce Date: Wed, 11 Jan 2006 02:57:23 +0000 Subject: [PATCH] - reconcile start_threads.c to agree with Bob's version in branch portaudio Notice that I have an explicit #ifdef USE_PORTAUDIO for later use. The alsa code was swapping around the original iret1 iret2 and thread1 thread2 also making it confusing. This should 100% agree with what Bob had now for USE_PORTAUDIO. This code should be re-factored if we are keeping alsa, start_threads.c should have no audio code in it. Something like jtaudio_portaudio.c jtaudio_alsa.c jtaudio_oss.c would be what I would do, with the file to compile chosen at configure time. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@83 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- start_threads.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/start_threads.c b/start_threads.c index 678bdec89..bab0244bd 100644 --- a/start_threads.c +++ b/start_threads.c @@ -515,9 +515,9 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], pthread_t thread1,thread2; int iret1,iret2; int iarg1 = 1,iarg2 = 2; +#ifdef USE_ALSA //int32_t rate=11025; int32_t rate=*nfsample; -#ifdef USE_ALSA alsa_driver_capture.app_buffer_y1 = y1; alsa_driver_capture.app_buffer_y2 = y2; alsa_driver_capture.app_buffer_offset = iwrite; @@ -534,10 +534,8 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], alsa_driver_playback.nmode = nmode; alsa_driver_playback.transmitting = Transmitting; alsa_driver_playback.ndsec = ndsec; -#endif printf("start_threads creating thread for decode1\n"); iret1 = pthread_create(&thread1,NULL,decode1_,&iarg1); -#ifdef USE_ALSA /* Open audio card. */ printf("Starting alsa routines\n"); ao_alsa_open(&alsa_driver_playback, &rate, SND_PCM_STREAM_PLAYBACK); @@ -551,10 +549,12 @@ int start_threads_(int *ndevin, int *ndevout, short y1[], short y2[], snd_pcm_start(alsa_driver_capture.audio_fd); snd_pcm_prepare(alsa_driver_playback.audio_fd); //snd_pcm_start(alsa_driver_playback.audio_fd); -#else +#endif +#ifdef USE_PORTAUDIO /* snd_pcm_start */ printf("start_threads creating thread for a2d\n"); - iret1 = pthread_create(&thread2,NULL,a2d_,&iarg1); - // iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); + iret1 = pthread_create(&thread1,NULL,a2d_,&iarg1); + printf("start_threads creating thread for decode1_\n"); + iret2 = pthread_create(&thread2,NULL,decode1_,&iarg2); #endif }