Changeset 5731
- Timestamp:
- Jan 24, 2018 2:37:39 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/opus.c
r5728 r5731 26 26 #include <pjmedia/endpoint.h> 27 27 #include <pj/log.h> 28 #include <pj/math.h> 28 29 29 30 #if defined(PJMEDIA_HAS_OPUS_CODEC) && (PJMEDIA_HAS_OPUS_CODEC!=0) … … 976 977 * is missing. 977 978 */ 979 frm_size = output->size / (sizeof(opus_int16) * 980 opus_data->cfg.channel_cnt); 978 981 if (inframe->type != PJMEDIA_FRAME_TYPE_AUDIO || fec) { 979 frm_size = opus_data->cfg.sample_rate * opus_data->ptime / 1000; 980 } else { 981 frm_size = output->size / (sizeof(opus_int16) * 982 opus_data->cfg.channel_cnt); 982 frm_size = PJ_MIN(frm_size, 983 opus_data->cfg.sample_rate * 984 opus_data->ptime / 1000); 983 985 } 984 986 decoded_samples = opus_decode( opus_data->dec, … … 1051 1053 1052 1054 inframe = &opus_data->dec_frame[opus_data->dec_frame_index]; 1055 frm_size = output->size / (sizeof(opus_int16) * 1056 opus_data->cfg.channel_cnt); 1053 1057 if (inframe->type != PJMEDIA_FRAME_TYPE_AUDIO) { 1054 frm_size = opus_data->cfg.sample_rate * opus_data->ptime/1000; 1055 } else { 1056 frm_size = output->size / (sizeof(opus_int16) * 1057 opus_data->cfg.channel_cnt); 1058 frm_size = PJ_MIN(frm_size, opus_data->cfg.sample_rate * 1059 opus_data->ptime/1000); 1058 1060 } 1059 1061 decoded_samples = opus_decode(opus_data->dec,
Note: See TracChangeset
for help on using the changeset viewer.