Changeset 5920 for pjproject/trunk/pjmedia/src/pjmedia-audiodev/wmme_dev.c
- Timestamp:
- Dec 12, 2018 7:16:46 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/wmme_dev.c
r5035 r5920 24 24 #include <pj/string.h> 25 25 #include <pj/unicode.h> 26 #include <pjmedia/event.h> 26 27 27 28 #if PJMEDIA_AUDIO_DEV_HAS_WMME … … 894 895 static unsigned rec_cnt, play_cnt; 895 896 enum { MAX_BURST = 1000 }; 897 pjmedia_dir signalled_dir = PJMEDIA_DIR_NONE; 896 898 897 899 /* Suppress compile warning for unused debugging vars */ … … 928 930 929 931 DWORD rc; 930 pjmedia_dir signalled_dir;931 932 932 933 /* Swap hWaveIn and hWaveOut to get equal opportunity for both */ … … 1047 1048 if (mr != MMSYSERR_NOERROR) { 1048 1049 status = PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_OUT(mr); 1050 PJ_PERROR(3, (THIS_FILE, status, 1051 "Failed to write audio frame for playback")); 1049 1052 break; 1050 1053 } … … 1149 1152 if (mr != MMSYSERR_NOERROR) { 1150 1153 status = PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_IN(mr); 1154 PJ_PERROR(3, (THIS_FILE, status, 1155 "Failed to add recording buffer")); 1151 1156 break; 1152 1157 } … … 1169 1174 1170 1175 PJ_LOG(5,(THIS_FILE, "WMME: thread stopping..")); 1176 1177 if (status != PJ_SUCCESS) { 1178 pjmedia_event e; 1179 pj_timestamp *ts; 1180 pjmedia_aud_param param; 1181 1182 PJ_PERROR(3, (THIS_FILE, status, "WMME thread stopped due to error")); 1183 1184 /* Broadcast WMME error */ 1185 pj_assert(signalled_dir != PJMEDIA_DIR_NONE); 1186 ts = (signalled_dir==PJMEDIA_DIR_PLAYBACK)? 1187 &strm->play_strm.timestamp : &strm->rec_strm.timestamp; 1188 pjmedia_event_init(&e, PJMEDIA_EVENT_AUD_DEV_ERROR, ts, &strm->base); 1189 e.data.aud_dev_err.dir = signalled_dir; 1190 e.data.aud_dev_err.status = status; 1191 e.data.aud_dev_err.id = PJMEDIA_AUD_INVALID_DEV; 1192 if (pjmedia_aud_stream_get_param(&strm->base, ¶m) == PJ_SUCCESS) { 1193 e.data.aud_dev_err.id = (signalled_dir==PJMEDIA_DIR_PLAYBACK)? 1194 param.play_id : param.rec_id; 1195 } 1196 1197 pjmedia_event_publish(NULL, &strm->base, &e, 1198 PJMEDIA_EVENT_PUBLISH_DEFAULT); 1199 } 1200 1171 1201 return 0; 1172 1202 }
Note: See TracChangeset
for help on using the changeset viewer.