Changeset 3136 for pjproject/trunk
- Timestamp:
- Apr 12, 2010 10:42:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_aps_dev.cpp
r3135 r3136 182 182 } 183 183 184 /* 185 * Utility: wait for specified time. 186 */ 187 static void snd_wait(unsigned ms) 188 { 189 TTime start, now; 190 191 start.UniversalTime(); 192 do { 193 pj_symbianos_poll(-1, ms); 194 now.UniversalTime(); 195 } while (now.MicroSecondsFrom(start) < ms * 1000); 196 } 197 184 198 typedef void(*PjAudioCallback)(TAPSCommBuffer &buf, void *user_data); 185 199 … … 652 666 653 667 if (session_opened) { 654 TTime start, now;655 668 enum { APS_CLOSE_WAIT_TIME = 200 }; /* in msecs */ 656 669 … … 658 671 // APS server panic KERN-EXEC 0, so let's wait for sometime before 659 672 // closing the client session. 660 start.UniversalTime(); 661 do { 662 pj_symbianos_poll(-1, APS_CLOSE_WAIT_TIME); 663 now.UniversalTime(); 664 } while (now.MicroSecondsFrom(start) < APS_CLOSE_WAIT_TIME * 1000); 673 snd_wait(APS_CLOSE_WAIT_TIME); 665 674 666 675 iSession.Close(); … … 1357 1366 if (err == KErrNone) 1358 1367 err = iSession.InitializeRecorder(iRecSettings); 1368 1369 // On some devices, immediate closing causes APS Server panic, 1370 // e.g: N95, so let's just wait for some time before closing. 1371 enum { APS_CLOSE_WAIT_TIME = 200 }; /* in msecs */ 1372 snd_wait(APS_CLOSE_WAIT_TIME); 1373 1359 1374 iSession.Close(); 1360 1375 … … 1366 1381 * let's wait before retrying. 1367 1382 */ 1368 enum { RETRY_WAIT = 3000 }; /* in msecs */ 1369 TTime start, now; 1370 1371 start.UniversalTime(); 1372 do { 1373 pj_symbianos_poll(-1, RETRY_WAIT); 1374 now.UniversalTime(); 1375 } while (now.MicroSecondsFrom(start) < RETRY_WAIT * 1000); 1383 enum { RETRY_WAIT_TIME = 3000 }; /* in msecs */ 1384 snd_wait(RETRY_WAIT_TIME); 1376 1385 } else { 1377 1386 /* Seems that this format is not supported */
Note: See TracChangeset
for help on using the changeset viewer.