- Timestamp:
- Feb 18, 2009 2:28:49 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/conf_switch.c
r2457 r2460 588 588 dst_port = conf->ports[sink_slot]; 589 589 590 /* Source and sink format must match. */ 591 if (src_port->info->format.fmt_id != dst_port->info->format.fmt_id) { 590 /* Format must match. */ 591 if (src_port->info->format.id != dst_port->info->format.id || 592 src_port->info->format.bitrate != dst_port->info->format.bitrate) 593 { 592 594 pj_mutex_unlock(conf->mutex); 593 595 return PJMEDIA_ENOTCOMPATIBLE; 596 } 597 598 /* Clock rate must match. */ 599 if (src_port->info->clock_rate != dst_port->info->clock_rate) { 600 pj_mutex_unlock(conf->mutex); 601 return PJMEDIA_ENCCLOCKRATE; 602 } 603 604 /* Channel count must match. */ 605 if (src_port->info->channel_count != dst_port->info->channel_count) { 606 pj_mutex_unlock(conf->mutex); 607 return PJMEDIA_ENCCLOCKRATE; 594 608 } 595 609 … … 866 880 info->listener_cnt = conf_port->listener_cnt; 867 881 info->listener_slots = conf_port->listener_slots; 882 info->transmitter_cnt = conf_port->transmitter_cnt; 868 883 info->clock_rate = conf_port->info->clock_rate; 869 884 info->channel_count = conf_port->info->channel_count; … … 952 967 953 968 /* Level adjustment is applicable only for ports that work with raw PCM. */ 954 PJ_ASSERT_RETURN(conf_port->info->format. fmt_id == PJMEDIA_FORMAT_L16,969 PJ_ASSERT_RETURN(conf_port->info->format.id == PJMEDIA_FORMAT_L16, 955 970 PJ_EIGNORED); 956 971 … … 986 1001 987 1002 /* Level adjustment is applicable only for ports that work with raw PCM. */ 988 PJ_ASSERT_RETURN(conf_port->info->format. fmt_id == PJMEDIA_FORMAT_L16,1003 PJ_ASSERT_RETURN(conf_port->info->format.id == PJMEDIA_FORMAT_L16, 989 1004 PJ_EIGNORED); 990 1005 … … 1050 1065 f_start = (pj_int16_t*)frm_src->buf; 1051 1066 f_end = f_start + (frm_src->size >> 1); 1067 1052 1068 while (f_start < f_end) { 1053 1069 unsigned nsamples_to_copy, nsamples_req; … … 1111 1127 /* Check port format. */ 1112 1128 if (cport_dst->port && 1113 cport_dst->port->info.format. fmt_id == PJMEDIA_FORMAT_L16)1129 cport_dst->port->info.format.id == PJMEDIA_FORMAT_L16) 1114 1130 { 1115 1131 /* When there is already some samples in listener's TX buffer, … … 1210 1226 { 1211 1227 cport->rx_level = 0; 1228 pj_add_timestamp32(&cport->ts_rx, 1229 conf->master_port->info.samples_per_frame); 1212 1230 continue; 1213 1231 } … … 1226 1244 1227 1245 f->buf = &conf->buf[sizeof(pjmedia_frame)]; 1228 f->size = BUFFER_SIZE - sizeof(pjmedia_frame);1246 f->size = cport->info->samples_per_frame<<1; 1229 1247 1230 1248 /* Get frame from port. */
Note: See TracChangeset
for help on using the changeset viewer.