- Timestamp:
- Dec 10, 2010 11:04:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_media.c
r3383 r3392 1969 1969 { 1970 1970 need_reopen = (peer_info.format.id != port0_info.format.id || 1971 peer_info.format.bitrate != port0_info.format.bitrate || 1971 peer_info.format.det.aud.avg_bps != 1972 port0_info.format.det.aud.avg_bps || 1972 1973 peer_info.clock_rate != port0_info.clock_rate || 1973 peer_info.channel_count !=port0_info.channel_count);1974 peer_info.channel_count!=port0_info.channel_count); 1974 1975 } 1975 1976 … … 1986 1987 peer_info.bits_per_sample); 1987 1988 if (status != PJ_SUCCESS) { 1988 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1989 pjsua_perror(THIS_FILE, "Error opening sound device", 1990 status); 1989 1991 return status; 1990 1992 } … … 1998 2000 status = open_snd_dev(¶m); 1999 2001 if (status != PJ_SUCCESS) { 2000 pjsua_perror(THIS_FILE, "Error opening sound device", status); 2002 pjsua_perror(THIS_FILE, "Error opening sound device", 2003 status); 2001 2004 return status; 2002 2005 } 2003 2006 } else { 2004 2007 /* Null-audio */ 2005 status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 2008 status = pjsua_set_snd_dev(pjsua_var.cap_dev, 2009 pjsua_var.play_dev); 2006 2010 if (status != PJ_SUCCESS) { 2007 pjsua_perror(THIS_FILE, "Error opening sound device", status); 2011 pjsua_perror(THIS_FILE, "Error opening sound device", 2012 status); 2008 2013 return status; 2009 2014 } … … 2142 2147 pool, path, 2143 2148 pjsua_var.mconf_cfg.samples_per_frame * 2144 1000 / pjsua_var.media_cfg.channel_count / 2149 1000 / pjsua_var.media_cfg.channel_count / 2145 2150 pjsua_var.media_cfg.clock_rate, 2146 2151 options, 0, &port); … … 2706 2711 if (!pjsua_var.is_mswitch && 2707 2712 param->ext_fmt.id == PJMEDIA_FORMAT_PCM && 2708 conf_port->info.clock_rate!= param->clock_rate)2713 PJMEDIA_PIA_SRATE(&conf_port->info) != param->clock_rate) 2709 2714 { 2710 2715 pjmedia_port *resample_port; … … 2742 2747 */ 2743 2748 if (pjsua_var.is_mswitch) { 2744 pj_memcpy(&conf_port->info.format, ¶m->ext_fmt, 2745 sizeof(conf_port->info.format)); 2746 conf_port->info.clock_rate = param->clock_rate; 2747 conf_port->info.samples_per_frame = param->samples_per_frame; 2748 conf_port->info.channel_count = param->channel_count; 2749 conf_port->info.bits_per_sample = 16; 2750 } 2749 pj_memcpy(&conf_port->info.fmt, ¶m->ext_fmt, 2750 sizeof(conf_port->info.fmt)); 2751 conf_port->info.fmt.det.aud.clock_rate = param->clock_rate; 2752 conf_port->info.fmt.det.aud.frame_time_usec = param->samples_per_frame* 2753 1000000 / 2754 param->clock_rate; 2755 conf_port->info.fmt.det.aud.channel_count = param->channel_count; 2756 conf_port->info.fmt.det.aud.bits_per_sample = 16; 2757 } 2758 2751 2759 2752 2760 /* Connect sound port to the bridge */
Note: See TracChangeset
for help on using the changeset viewer.