Changeset 319 for pjproject/trunk/pjmedia/src/pjmedia/conference.c
- Timestamp:
- Mar 15, 2006 8:56:04 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r318 r319 140 140 unsigned samples_per_frame; /**< Samples per frame. */ 141 141 unsigned bits_per_sample; /**< Bits per sample. */ 142 pj_snd_stream_info snd_info; /**< Sound device parameter. */143 142 }; 144 143 … … 287 286 288 287 289 /* Init default sound device parameters. */290 pj_memset(&conf->snd_info, 0, sizeof(conf->snd_info));291 conf->snd_info.samples_per_sec = conf->clock_rate;292 conf->snd_info.bits_per_sample = conf->bits_per_sample;293 conf->snd_info.samples_per_frame = conf->samples_per_frame;294 conf->snd_info.bytes_per_frame = conf->samples_per_frame *295 conf->bits_per_sample / 8;296 conf->snd_info.frames_per_packet = 1;297 298 288 299 289 /* Create port */ … … 389 379 static pj_status_t create_sound( pjmedia_conf *conf ) 390 380 { 381 pj_status_t status; 382 391 383 /* Open recorder only if mic is not disabled. */ 392 384 if ((conf->options & PJMEDIA_CONF_NO_MIC) == 0) { 393 conf->snd_rec = pj_snd_open_recorder(-1 ,&conf->snd_info, 394 &rec_cb, conf); 395 if (conf->snd_rec == NULL) { 396 return -1; 385 status = pj_snd_open_recorder(-1, conf->clock_rate, 1, 386 conf->samples_per_frame, 387 conf->bits_per_sample, 388 &rec_cb, conf, &conf->snd_rec); 389 if (status != PJ_SUCCESS) { 390 conf->snd_rec = NULL; 391 return status; 397 392 } 398 393 } 399 394 400 395 /* Open player */ 401 conf->snd_player = pj_snd_open_player(-1, &conf->snd_info, &play_cb, conf); 402 if (conf->snd_player == NULL) { 396 status = pj_snd_open_player(-1, conf->clock_rate, 1, 397 conf->samples_per_frame, 398 conf->bits_per_sample, 399 &play_cb, conf, &conf->snd_player); 400 if (status != PJ_SUCCESS) { 403 401 if (conf->snd_rec) { 404 402 pj_snd_stream_close(conf->snd_rec); 403 conf->snd_rec = NULL; 405 404 } 406 return -1; 405 conf->snd_player = NULL; 406 return status; 407 407 } 408 408
Note: See TracChangeset
for help on using the changeset viewer.