Changeset 4730


Ignore:
Timestamp:
Feb 4, 2014 1:24:28 PM (6 years ago)
Author:
bennylp
Message:

Fixed #1732: Error setting audio output route in BlackBerry? 10 (BB10) version 10.2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/bb10_dev.c

    r4728 r4730  
    455455                                         SND_PCM_CHANNEL_PLAYBACK)) < 0) 
    456456    { 
    457         close_play_pcm(stream); 
    458457        TRACE_((THIS_FILE, "pb_thread_func failed prepare = %d", result)); 
    459458        return PJ_SUCCESS; 
     
    516515 
    517516    flush_play(stream); 
    518     close_play_pcm(stream); 
    519517    TRACE_((THIS_FILE, "pb_thread_func: Stopped")); 
    520518 
     
    551549                                          SND_PCM_CHANNEL_CAPTURE)) < 0) 
    552550    { 
    553         close_capture_pcm(stream); 
    554551        TRACE_((THIS_FILE, "ca_thread_func failed prepare = %d", result)); 
    555552        return PJ_SUCCESS; 
     
    617614 
    618615    flush_capture(stream); 
    619     close_capture_pcm(stream); 
    620616    TRACE_((THIS_FILE, "ca_thread_func: Stopped")); 
    621617 
     
    10331029    { 
    10341030        pjmedia_aud_dev_route route; 
     1031        pj_bool_t need_restart; 
    10351032        pj_status_t ret; 
    10361033 
    10371034        PJ_ASSERT_RETURN(value, PJ_EINVAL); 
    10381035 
     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 
    10391047        route = *((pjmedia_aud_dev_route*)value); 
     1048        PJ_LOG(4,(THIS_FILE, "setting audio route to %d..", route)); 
     1049 
    10401050        /* Use the initialization function which lazy-inits the 
    10411051         * handle for routing 
     
    10461056            ret = bb10_initialize_playback_ctrl(stream,false); 
    10471057        } 
     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 
    10481067        return ret; 
    10491068 
     
    11301149    bb10_stream_stop (s); 
    11311150 
     1151    close_play_pcm(stream); 
     1152    close_capture_pcm(stream); 
     1153 
    11321154    pj_pool_release (stream->pool); 
    11331155 
Note: See TracChangeset for help on using the changeset viewer.