Changeset 2007 for pjproject/trunk/pjmedia/src/pjmedia/pasound.c
- Timestamp:
- Jun 12, 2008 12:48:59 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/pasound.c
r1919 r2007 29 29 #define THIS_FILE "pasound.c" 30 30 31 #define MAX_LATENCY (PJMEDIA_PASOUND_MAX_LATENCY / 1000.0)32 33 31 static int snd_init_count; 32 33 /* Latency settings */ 34 static unsigned snd_input_latency = PJMEDIA_SND_DEFAULT_REC_LATENCY; 35 static unsigned snd_output_latency = PJMEDIA_SND_DEFAULT_PLAY_LATENCY; 34 36 35 37 static struct snd_mgr … … 562 564 inputParam.hostApiSpecificStreamInfo = NULL; 563 565 inputParam.sampleFormat = sampleFormat; 564 inputParam.suggestedLatency = paDevInfo->defaultLowInputLatency; 565 if (inputParam.suggestedLatency > MAX_LATENCY) 566 inputParam.suggestedLatency = MAX_LATENCY; 566 inputParam.suggestedLatency = snd_input_latency / 1000.0; 567 567 568 568 paHostApiInfo = Pa_GetHostApiInfo(paDevInfo->hostApi); … … 664 664 outputParam.hostApiSpecificStreamInfo = NULL; 665 665 outputParam.sampleFormat = sampleFormat; 666 outputParam.suggestedLatency = paDevInfo->defaultLowOutputLatency; 667 if (outputParam.suggestedLatency > MAX_LATENCY) 668 outputParam.suggestedLatency = MAX_LATENCY; 666 outputParam.suggestedLatency = snd_output_latency / 1000.0; 669 667 670 668 paHostApiInfo = Pa_GetHostApiInfo(paDevInfo->hostApi); … … 795 793 inputParam.hostApiSpecificStreamInfo = NULL; 796 794 inputParam.sampleFormat = sampleFormat; 797 inputParam.suggestedLatency = paRecDevInfo->defaultLowInputLatency; 798 if (inputParam.suggestedLatency > MAX_LATENCY) 799 inputParam.suggestedLatency = MAX_LATENCY; 795 inputParam.suggestedLatency = snd_input_latency / 1000.0; 800 796 801 797 paRecHostApiInfo = Pa_GetHostApiInfo(paRecDevInfo->hostApi); … … 806 802 outputParam.hostApiSpecificStreamInfo = NULL; 807 803 outputParam.sampleFormat = sampleFormat; 808 outputParam.suggestedLatency = paPlayDevInfo->defaultLowOutputLatency; 809 if (outputParam.suggestedLatency > MAX_LATENCY) 810 outputParam.suggestedLatency = MAX_LATENCY; 804 outputParam.suggestedLatency = snd_output_latency / 1000.0; 811 805 812 806 paPlayHostApiInfo = Pa_GetHostApiInfo(paPlayDevInfo->hostApi); … … 1013 1007 } 1014 1008 1009 /* 1010 * Set sound latency. 1011 */ 1012 PJ_DEF(pj_status_t) pjmedia_snd_set_latency(unsigned input_latency, 1013 unsigned output_latency) 1014 { 1015 snd_input_latency = (input_latency == 0)? 1016 PJMEDIA_SND_DEFAULT_REC_LATENCY : input_latency; 1017 snd_output_latency = (output_latency == 0)? 1018 PJMEDIA_SND_DEFAULT_PLAY_LATENCY : output_latency; 1019 1020 return PJ_SUCCESS; 1021 } 1015 1022 1016 1023 #endif /* PJMEDIA_SOUND_IMPLEMENTATION */
Note: See TracChangeset
for help on using the changeset viewer.