- Timestamp:
- Feb 4, 2014 1:24:28 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-audiodev/bb10_dev.c
r4728 r4730 455 455 SND_PCM_CHANNEL_PLAYBACK)) < 0) 456 456 { 457 close_play_pcm(stream);458 457 TRACE_((THIS_FILE, "pb_thread_func failed prepare = %d", result)); 459 458 return PJ_SUCCESS; … … 516 515 517 516 flush_play(stream); 518 close_play_pcm(stream);519 517 TRACE_((THIS_FILE, "pb_thread_func: Stopped")); 520 518 … … 551 549 SND_PCM_CHANNEL_CAPTURE)) < 0) 552 550 { 553 close_capture_pcm(stream);554 551 TRACE_((THIS_FILE, "ca_thread_func failed prepare = %d", result)); 555 552 return PJ_SUCCESS; … … 617 614 618 615 flush_capture(stream); 619 close_capture_pcm(stream);620 616 TRACE_((THIS_FILE, "ca_thread_func: Stopped")); 621 617 … … 1033 1029 { 1034 1030 pjmedia_aud_dev_route route; 1031 pj_bool_t need_restart; 1035 1032 pj_status_t ret; 1036 1033 1037 1034 PJ_ASSERT_RETURN(value, PJ_EINVAL); 1038 1035 1036 /* OS 10.2.1 requires pausing audio stream */ 1037 need_restart = (stream->pb_thread != NULL); 1038 if (need_restart) { 1039 PJ_LOG(4,(THIS_FILE, "pausing audio stream..")); 1040 ret = bb10_stream_stop(strm); 1041 if (ret != PJ_SUCCESS) { 1042 PJ_PERROR(1,(THIS_FILE, ret, "Error pausing stream")); 1043 return ret; 1044 } 1045 } 1046 1039 1047 route = *((pjmedia_aud_dev_route*)value); 1048 PJ_LOG(4,(THIS_FILE, "setting audio route to %d..", route)); 1049 1040 1050 /* Use the initialization function which lazy-inits the 1041 1051 * handle for routing … … 1046 1056 ret = bb10_initialize_playback_ctrl(stream,false); 1047 1057 } 1058 1059 if (need_restart) { 1060 PJ_LOG(4,(THIS_FILE, "resuming audio stream..")); 1061 ret = bb10_stream_start(strm); 1062 if (ret != PJ_SUCCESS) { 1063 PJ_PERROR(1,(THIS_FILE, ret, "Error resuming stream")); 1064 } 1065 } 1066 1048 1067 return ret; 1049 1068 … … 1130 1149 bb10_stream_stop (s); 1131 1150 1151 close_play_pcm(stream); 1152 close_capture_pcm(stream); 1153 1132 1154 pj_pool_release (stream->pool); 1133 1155
Note: See TracChangeset
for help on using the changeset viewer.