Changeset 2742 for pjproject/trunk
- Timestamp:
- Jun 3, 2009 6:59:37 PM (15 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/audiodev.c
r2740 r2742 598 598 PJ_ASSERT_RETURN(prm && prm->dir && p_aud_strm, PJ_EINVAL); 599 599 PJ_ASSERT_RETURN(aud_subsys.pf, PJMEDIA_EAUD_INIT); 600 PJ_ASSERT_RETURN(prm->dir==PJMEDIA_DIR_CAPTURE || 601 prm->dir==PJMEDIA_DIR_PLAYBACK || 602 prm->dir==PJMEDIA_DIR_CAPTURE_PLAYBACK, 603 PJ_EINVAL); 600 604 601 605 /* Must make copy of param because we're changing device ID */ … … 631 635 f = play_f; 632 636 } 637 638 PJ_ASSERT_RETURN(f != NULL, PJ_EBUG); 633 639 634 640 /* For now, rec_id and play_id must belong to the same factory */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r2741 r2742 1721 1721 1722 1722 if (need_reopen) { 1723 pjmedia_aud_param param; 1724 1725 /* Create parameter based on peer info */ 1726 status = create_aud_param(¶m, pjsua_var.cap_dev, 1727 pjsua_var.play_dev, 1728 peer_info.clock_rate, 1729 peer_info.channel_count, 1730 peer_info.samples_per_frame, 1731 peer_info.bits_per_sample); 1732 1733 /* And peer format */ 1734 if (peer_info.format.id != PJMEDIA_FORMAT_PCM) { 1735 param.flags |= PJMEDIA_AUD_DEV_CAP_EXT_FORMAT; 1736 param.ext_fmt = peer_info.format; 1737 } 1738 1739 status = open_snd_dev(¶m); 1740 if (status != PJ_SUCCESS) { 1741 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1742 return status; 1723 if (pjsua_var.cap_dev != NULL_SND_DEV_ID) { 1724 pjmedia_aud_param param; 1725 1726 /* Create parameter based on peer info */ 1727 status = create_aud_param(¶m, pjsua_var.cap_dev, 1728 pjsua_var.play_dev, 1729 peer_info.clock_rate, 1730 peer_info.channel_count, 1731 peer_info.samples_per_frame, 1732 peer_info.bits_per_sample); 1733 if (status != PJ_SUCCESS) { 1734 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1735 return status; 1736 } 1737 1738 /* And peer format */ 1739 if (peer_info.format.id != PJMEDIA_FORMAT_PCM) { 1740 param.flags |= PJMEDIA_AUD_DEV_CAP_EXT_FORMAT; 1741 param.ext_fmt = peer_info.format; 1742 } 1743 1744 status = open_snd_dev(¶m); 1745 if (status != PJ_SUCCESS) { 1746 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1747 return status; 1748 } 1749 } else { 1750 /* Null-audio */ 1751 status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 1752 if (status != PJ_SUCCESS) { 1753 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1754 return status; 1755 } 1743 1756 } 1744 1757 }
Note: See TracChangeset
for help on using the changeset viewer.