Changeset 1823 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Feb 26, 2008 3:32:16 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r1810 r1823 1772 1772 pjmedia_port *conf_port; 1773 1773 const pjmedia_snd_dev_info *play_info; 1774 unsigned clock_rates[] = { 0, 22050, 44100, 48000, 11025, 32000, 8000}; 1774 unsigned clock_rates[] = {0, 22050, 44100, 48000, 32000, 16000, 1775 8000}; 1775 1776 unsigned selected_clock_rate = 0; 1776 1777 unsigned i; … … 1785 1786 1786 1787 /* Set default clock rate */ 1787 clock_rates[0] = pjsua_var.media_cfg.clock_rate; 1788 clock_rates[0] = pjsua_var.media_cfg.snd_clock_rate; 1789 if (clock_rates[0] == 0) 1790 clock_rates[0] = pjsua_var.media_cfg.clock_rate; 1788 1791 1789 1792 /* Attempts to open the sound device with different clock rates */ … … 1832 1835 if (selected_clock_rate != pjsua_var.media_cfg.clock_rate) { 1833 1836 pjmedia_port *resample_port; 1834 1837 unsigned resample_opt = 0; 1838 1839 if (pjsua_var.media_cfg.quality >= 3 && 1840 pjsua_var.media_cfg.quality <= 4) 1841 { 1842 resample_opt |= PJMEDIA_CONF_SMALL_FILTER; 1843 } 1844 else if (pjsua_var.media_cfg.quality < 3) { 1845 resample_opt |= PJMEDIA_CONF_USE_LINEAR; 1846 } 1847 1835 1848 status = pjmedia_resample_port_create(pjsua_var.pool, conf_port, 1836 selected_clock_rate, 0,1837 &resample_port);1849 selected_clock_rate, 1850 resample_opt, &resample_port); 1838 1851 if (status != PJ_SUCCESS) { 1839 1852 pjsua_perror("Error creating resample port", THIS_FILE, status); … … 1864 1877 play_info = pjmedia_snd_get_dev_info(si.rec_id); 1865 1878 1866 pjmedia_conf_set_port0_name(pjsua_var.mconf, 1867 pj_cstr(&tmp, play_info->name)); 1879 if (si.clock_rate != pjsua_var.media_cfg.clock_rate) { 1880 char tmp_buf[128]; 1881 int tmp_buf_len = sizeof(tmp_buf); 1882 1883 tmp_buf_len = pj_ansi_snprintf(tmp_buf, sizeof(tmp_buf)-1, "%s (%dKHz)", 1884 play_info->name, si.clock_rate/1000); 1885 pj_strset(&tmp, tmp_buf, tmp_buf_len); 1886 pjmedia_conf_set_port0_name(pjsua_var.mconf, &tmp); 1887 } else { 1888 pjmedia_conf_set_port0_name(pjsua_var.mconf, 1889 pj_cstr(&tmp, play_info->name)); 1890 } 1868 1891 1869 1892 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.