Changeset 1041 for pjproject/trunk
- Timestamp:
- Mar 5, 2007 1:13:22 PM (18 years ago)
- Location:
- pjproject/trunk/pjmedia/src/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/dsound.c
r974 r1041 57 57 static unsigned dev_count; 58 58 static struct dsound_dev_info dev_info[MAX_HARDWARE]; 59 59 static int snd_init_count; 60 60 61 61 … … 638 638 unsigned i; 639 639 640 if (++snd_init_count != 1) 641 return PJ_SUCCESS; 642 640 643 pool_factory = factory; 641 644 … … 667 670 PJ_DEF(pj_status_t) pjmedia_snd_deinit(void) 668 671 { 672 --snd_init_count; 669 673 return PJ_SUCCESS; 670 674 } -
pjproject/trunk/pjmedia/src/pjmedia/pasound.c
r974 r1041 29 29 #define THIS_FILE "pasound.c" 30 30 31 static int snd_init_count; 32 31 33 static struct snd_mgr 32 34 { … … 194 196 PJ_DEF(pj_status_t) pjmedia_snd_init(pj_pool_factory *factory) 195 197 { 196 int err; 197 198 snd_mgr.factory = factory; 199 err = Pa_Initialize(); 200 201 PJ_LOG(4,(THIS_FILE, "PortAudio sound library initialized, status=%d", err)); 202 PJ_LOG(4,(THIS_FILE, "PortAudio host api count=%d", 203 Pa_GetHostApiCount())); 204 PJ_LOG(4,(THIS_FILE, "Sound device count=%d", 205 pjmedia_snd_get_dev_count())); 206 207 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 198 if (++snd_init_count == 1) { 199 int err; 200 201 snd_mgr.factory = factory; 202 err = Pa_Initialize(); 203 204 PJ_LOG(4,(THIS_FILE, 205 "PortAudio sound library initialized, status=%d", err)); 206 PJ_LOG(4,(THIS_FILE, "PortAudio host api count=%d", 207 Pa_GetHostApiCount())); 208 PJ_LOG(4,(THIS_FILE, "Sound device count=%d", 209 pjmedia_snd_get_dev_count())); 210 211 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 212 } else { 213 return PJ_SUCCESS; 214 } 208 215 } 209 216 … … 805 812 PJ_DEF(pj_status_t) pjmedia_snd_deinit(void) 806 813 { 807 int err; 808 809 PJ_LOG(4,(THIS_FILE, "PortAudio sound library shutting down..")); 810 811 err = Pa_Terminate(); 812 813 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 814 if (--snd_init_count == 0) { 815 int err; 816 817 PJ_LOG(4,(THIS_FILE, "PortAudio sound library shutting down..")); 818 819 err = Pa_Terminate(); 820 821 return err ? PJMEDIA_ERRNO_FROM_PORTAUDIO(err) : PJ_SUCCESS; 822 } else { 823 return PJ_SUCCESS; 824 } 814 825 } 815 826
Note: See TracChangeset
for help on using the changeset viewer.