Ignore:
Timestamp:
Sep 18, 2011 2:59:56 PM (13 years ago)
Author:
bennylp
Message:

Modified the libraries to use the new log indentation feature re #1372

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r3714 r3753  
    7373    PJ_UNUSED_ARG(codec_id); 
    7474 
     75    pj_log_push_indent(); 
     76 
    7577    /* Specify which audio device settings are save-able */ 
    7678    pjsua_var.aud_svmask = 0xFFFFFFFF; 
     
    111113                     "Media stack initialization has returned error",  
    112114                     status); 
    113         return status; 
     115        goto on_error; 
    114116    } 
    115117 
     
    138140                pjsua_perror(THIS_FILE, "Error querying audio device info", 
    139141                             status); 
    140                 return status; 
     142                goto on_error; 
    141143            } 
    142144             
     
    175177    if (status != PJ_SUCCESS) { 
    176178        PJ_PERROR(1,(THIS_FILE, status, "Error registering codecs")); 
    177         return status; 
     179        goto on_error; 
    178180    } 
    179181 
     
    229231        pjsua_perror(THIS_FILE, "Error creating conference bridge",  
    230232                     status); 
    231         return status; 
     233        goto on_error; 
    232234    } 
    233235 
     
    251253        pjsua_perror(THIS_FILE, "Error initializing SRTP library",  
    252254                     status); 
    253         return status; 
     255        goto on_error; 
    254256    } 
    255257#endif 
     
    259261    status = pjsua_vid_subsys_init(); 
    260262    if (status != PJ_SUCCESS) 
    261         return status; 
     263        goto on_error; 
    262264#endif 
    263265 
     266    pj_log_pop_indent(); 
    264267    return PJ_SUCCESS; 
     268 
     269on_error: 
     270    pj_log_pop_indent(); 
     271    return status; 
    265272} 
    266273 
     
    345352    pj_status_t status; 
    346353 
     354    pj_log_push_indent(); 
     355 
    347356#if DISABLED_FOR_TICKET_1185 
    348357    /* Create media for calls, if none is specified */ 
     
    355364 
    356365        status = pjsua_media_transports_create(&transport_cfg); 
    357         if (status != PJ_SUCCESS) 
     366        if (status != PJ_SUCCESS) { 
     367            pj_log_pop_indent(); 
    358368            return status; 
     369        } 
    359370    } 
    360371#endif 
     
    366377#if PJMEDIA_HAS_VIDEO 
    367378    status = pjsua_vid_subsys_start(); 
    368     if (status != PJ_SUCCESS) 
     379    if (status != PJ_SUCCESS) { 
     380        pj_log_pop_indent(); 
    369381        return status; 
     382    } 
    370383#endif 
    371384 
     
    376389    } 
    377390 
     391    pj_log_pop_indent(); 
    378392    return PJ_SUCCESS; 
    379393} 
     
    388402 
    389403    PJ_LOG(4,(THIS_FILE, "Shutting down media..")); 
     404    pj_log_push_indent(); 
    390405 
    391406    close_snd_dev(); 
     
    451466    /* Reset RTP port */ 
    452467    next_rtp_port = 0; 
     468 
     469    pj_log_pop_indent(); 
    453470 
    454471    return PJ_SUCCESS; 
     
    13641381        return PJ_EBUSY; 
    13651382 
     1383    PJ_LOG(4,(THIS_FILE, "Call %d: initializing media..", call_id)); 
     1384    pj_log_push_indent(); 
     1385 
    13661386#if DISABLED_FOR_TICKET_1185 
    13671387    /* Return error if media transport has not been created yet 
     
    13701390    for (i=0; i<call->med_cnt; ++i) { 
    13711391        if (call->media[i].tp == NULL) { 
    1372             return PJ_EBUSY; 
     1392            status = PJ_EBUSY; 
     1393            goto on_error; 
    13731394        } 
    13741395    } 
     
    13861407            if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 
    13871408            pjsua_media_channel_deinit(call_id); 
    1388             return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 
     1409            status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 
     1410            goto on_error; 
    13891411        } 
    13901412 
     
    14261448        if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE_HERE; 
    14271449        pjsua_media_channel_deinit(call_id); 
    1428         return PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 
     1450        status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_NOT_ACCEPTABLE_HERE); 
     1451        goto on_error; 
    14291452    } 
    14301453 
     
    14631486            if (status != PJ_SUCCESS) { 
    14641487                pjsua_media_channel_deinit(call_id); 
    1465                 return status; 
     1488                goto on_error; 
    14661489            } 
    14671490        } else { 
     
    15011524                if (sip_err_code) *sip_err_code = PJSIP_SC_NOT_ACCEPTABLE; 
    15021525                pjsua_media_channel_deinit(call_id); 
    1503                 return status; 
     1526                goto on_error; 
    15041527            } 
    15051528 
     
    15081531    } 
    15091532 
     1533    pj_log_pop_indent(); 
    15101534    return PJ_SUCCESS; 
     1535 
     1536on_error: 
     1537    pj_log_pop_indent(); 
     1538    return status; 
    15111539} 
    15121540 
     
    17911819    unsigned mi; 
    17921820 
     1821    pj_log_push_indent(); 
     1822 
    17931823    for (mi=0; mi<call->med_cnt; ++mi) { 
    17941824        pjsua_call_media *call_med = &call->media[mi]; 
     
    18391869        call_med->state = PJSUA_CALL_MEDIA_NONE; 
    18401870    } 
     1871 
     1872    pj_log_pop_indent(); 
    18411873} 
    18421874 
     
    18451877    pjsua_call *call = &pjsua_var.calls[call_id]; 
    18461878    unsigned mi; 
     1879 
     1880    PJ_LOG(4,(THIS_FILE, "Call %d: deinitializing media..", call_id)); 
     1881    pj_log_push_indent(); 
    18471882 
    18481883    stop_media_session(call_id); 
     
    18691904 
    18701905    check_snd_dev_idle(); 
     1906    pj_log_pop_indent(); 
    18711907 
    18721908    return PJ_SUCCESS; 
     
    18811917{ 
    18821918    PJ_UNUSED_ARG(strm); 
     1919 
     1920    pj_log_push_indent(); 
    18831921 
    18841922    /* For discussions about call mutex protection related to this  
     
    18921930        pjsua_var.ua_cfg.cb.on_dtmf_digit(call_id, digit); 
    18931931    } 
     1932 
     1933    pj_log_pop_indent(); 
    18941934} 
    18951935 
     
    19051945    unsigned strm_idx = call_med->idx; 
    19061946    pj_status_t status; 
     1947 
     1948    PJ_LOG(4,(THIS_FILE,"Audio channel update..")); 
     1949    pj_log_push_indent(); 
    19071950     
    19081951    status = pjmedia_stream_info_from_sdp(si, tmp_pool, pjsua_var.med_endpt, 
    19091952                                          local_sdp, remote_sdp, strm_idx); 
    19101953    if (status != PJ_SUCCESS) 
    1911         return status; 
     1954        goto on_return; 
    19121955 
    19131956    /* Check if no media is active */ 
     
    19271970                                               remote_sdp, strm_idx); 
    19281971        if (status != PJ_SUCCESS) 
    1929             return status; 
     1972            goto on_return; 
    19301973 
    19311974        call_med->tp_st = PJSUA_MED_TP_RUNNING; 
     
    19922035                                       &call_med->strm.a.stream); 
    19932036        if (status != PJ_SUCCESS) { 
    1994             return status; 
     2037            goto on_return; 
    19952038        } 
    19962039 
     
    19982041        status = pjmedia_stream_start(call_med->strm.a.stream); 
    19992042        if (status != PJ_SUCCESS) { 
    2000             return status; 
     2043            goto on_return; 
    20012044        } 
    20022045 
     
    20462089                                            &call_med->strm.a.conf_slot); 
    20472090            if (status != PJ_SUCCESS) { 
    2048                 return status; 
     2091                goto on_return; 
    20492092            } 
    20502093        } 
     
    20932136        if (len > 0) 
    20942137            info_len += len; 
    2095         PJ_LOG(4,(THIS_FILE,"Media updates%s", info)); 
    2096     } 
    2097  
    2098     return PJ_SUCCESS; 
     2138        PJ_LOG(4,(THIS_FILE,"Audio updated%s", info)); 
     2139    } 
     2140 
     2141on_return: 
     2142    pj_log_pop_indent(); 
     2143    return status; 
    20992144} 
    21002145 
     
    21202165    if (pjsua_get_state() != PJSUA_STATE_RUNNING) 
    21212166        return PJ_EBUSY; 
     2167 
     2168    PJ_LOG(4,(THIS_FILE, "Call %d: updating media..", call_id)); 
     2169    pj_log_push_indent(); 
    21222170 
    21232171    /* Destroy existing media session, if any. */ 
     
    21832231            PJ_LOG(1,(THIS_FILE, "Error updating media for call %d: " 
    21842232                      "invalid media index %d in SDP", call_id, mi)); 
    2185             return PJMEDIA_SDP_EINSDP; 
     2233            status = PJMEDIA_SDP_EINSDP; 
     2234            goto on_error; 
    21862235#endif 
    21872236        } 
     
    22362285        status = pjmedia_sdp_neg_set_remote_offer(tmp_pool, neg, remote_sdp); 
    22372286        if (status != PJ_SUCCESS) 
    2238             return status; 
     2287            goto on_error; 
    22392288 
    22402289        status = pjmedia_sdp_neg_set_local_answer(tmp_pool, neg, local_sdp); 
    22412290        if (status != PJ_SUCCESS) 
    2242             return status; 
     2291            goto on_error; 
    22432292 
    22442293        status = pjmedia_sdp_neg_negotiate(tmp_pool, neg, 0); 
    22452294        if (status != PJ_SUCCESS) 
    2246             return status; 
    2247     } 
    2248  
     2295            goto on_error; 
     2296    } 
     2297 
     2298    pj_log_pop_indent(); 
    22492299    return (got_media? PJ_SUCCESS : PJMEDIA_SDPNEG_ENOMEDIA); 
     2300 
     2301on_error: 
     2302    pj_log_pop_indent(); 
     2303    return status; 
    22502304} 
    22512305 
     
    23582412                                        pjsua_conf_port_id sink) 
    23592413{ 
     2414    pj_status_t status = PJ_SUCCESS; 
     2415 
     2416    PJ_LOG(4,(THIS_FILE, "%s connect: %d --> %d", 
     2417              (pjsua_var.is_mswitch ? "Switch" : "Conf"), 
     2418              source, sink)); 
     2419    pj_log_push_indent(); 
     2420 
    23602421    /* If sound device idle timer is active, cancel it first. */ 
    23612422    PJSUA_LOCK(); 
     
    23782439        unsigned peer_id; 
    23792440        pj_bool_t need_reopen = PJ_FALSE; 
    2380         pj_status_t status; 
    23812441 
    23822442        peer_id = (source!=0)? source : sink; 
     
    24202480                    pjsua_perror(THIS_FILE, "Error opening sound device", 
    24212481                                 status); 
    2422                     return status; 
     2482                    goto on_return; 
    24232483                } 
    24242484 
     
    24342494                    pjsua_perror(THIS_FILE, "Error opening sound device", 
    24352495                                 status); 
    2436                     return status; 
     2496                    goto on_return; 
    24372497                } 
    24382498            } else { 
     
    24432503                    pjsua_perror(THIS_FILE, "Error opening sound device", 
    24442504                                 status); 
    2445                     return status; 
     2505                    goto on_return; 
    24462506                } 
    24472507            } 
     
    24682528            if (status != PJ_SUCCESS) { 
    24692529                pjsua_perror(THIS_FILE, "Error opening sound device", status); 
    2470                 return status; 
     2530                goto on_return; 
    24712531            } 
    24722532        } else if (pjsua_var.no_snd && !pjsua_var.snd_is_on) { 
     
    24792539    } 
    24802540 
    2481     return pjmedia_conf_connect_port(pjsua_var.mconf, source, sink, 0); 
     2541    status = pjmedia_conf_connect_port(pjsua_var.mconf, source, sink, 0); 
     2542 
     2543on_return: 
     2544    pj_log_pop_indent(); 
     2545    return status; 
    24822546} 
    24832547 
     
    24912555    pj_status_t status; 
    24922556 
     2557    PJ_LOG(4,(THIS_FILE, "%s disconnect: %d -x- %d", 
     2558              (pjsua_var.is_mswitch ? "Switch" : "Conf"), 
     2559              source, sink)); 
     2560    pj_log_push_indent(); 
     2561 
    24932562    status = pjmedia_conf_disconnect_port(pjsua_var.mconf, source, sink); 
    24942563    check_snd_dev_idle(); 
    24952564 
     2565    pj_log_pop_indent(); 
    24962566    return status; 
    24972567} 
     
    25592629    unsigned slot, file_id; 
    25602630    char path[PJ_MAXPATH]; 
    2561     pj_pool_t *pool; 
     2631    pj_pool_t *pool = NULL; 
    25622632    pjmedia_port *port; 
    2563     pj_status_t status; 
     2633    pj_status_t status = PJ_SUCCESS; 
    25642634 
    25652635    if (pjsua_var.player_cnt >= PJ_ARRAY_SIZE(pjsua_var.player)) 
    25662636        return PJ_ETOOMANY; 
     2637 
     2638    PJ_LOG(4,(THIS_FILE, "Creating file player: %.*s..", 
     2639              (int)filename->slen, filename->ptr)); 
     2640    pj_log_push_indent(); 
    25672641 
    25682642    PJSUA_LOCK(); 
     
    25752649    if (file_id == PJ_ARRAY_SIZE(pjsua_var.player)) { 
    25762650        /* This is unexpected */ 
    2577         PJSUA_UNLOCK(); 
    25782651        pj_assert(0); 
    2579         return PJ_EBUG; 
     2652        status = PJ_EBUG; 
     2653        goto on_error; 
    25802654    } 
    25812655 
     
    25852659    pool = pjsua_pool_create(get_basename(path, filename->slen), 1000, 1000); 
    25862660    if (!pool) { 
    2587         PJSUA_UNLOCK(); 
    2588         return PJ_ENOMEM; 
     2661        status = PJ_ENOMEM; 
     2662        goto on_error; 
    25892663    } 
    25902664 
     
    25962670                                    options, 0, &port); 
    25972671    if (status != PJ_SUCCESS) { 
    2598         PJSUA_UNLOCK(); 
    25992672        pjsua_perror(THIS_FILE, "Unable to open file for playback", status); 
    2600         pj_pool_release(pool); 
    2601         return status; 
     2673        goto on_error; 
    26022674    } 
    26032675 
     
    26062678    if (status != PJ_SUCCESS) { 
    26072679        pjmedia_port_destroy(port); 
    2608         PJSUA_UNLOCK(); 
    26092680        pjsua_perror(THIS_FILE, "Unable to add file to conference bridge",  
    26102681                     status); 
    2611         pj_pool_release(pool); 
    2612         return status; 
     2682        goto on_error; 
    26132683    } 
    26142684 
     
    26232693 
    26242694    PJSUA_UNLOCK(); 
     2695 
     2696    PJ_LOG(4,(THIS_FILE, "Player created, id=%d, slot=%d", file_id, slot)); 
     2697 
     2698    pj_log_pop_indent(); 
    26252699    return PJ_SUCCESS; 
     2700 
     2701on_error: 
     2702    PJSUA_UNLOCK(); 
     2703    if (pool) pj_pool_release(pool); 
     2704    pj_log_pop_indent(); 
     2705    return status; 
    26262706} 
    26272707 
     
    26382718{ 
    26392719    unsigned slot, file_id, ptime; 
    2640     pj_pool_t *pool; 
     2720    pj_pool_t *pool = NULL; 
    26412721    pjmedia_port *port; 
    2642     pj_status_t status; 
     2722    pj_status_t status = PJ_SUCCESS; 
    26432723 
    26442724    if (pjsua_var.player_cnt >= PJ_ARRAY_SIZE(pjsua_var.player)) 
    26452725        return PJ_ETOOMANY; 
     2726 
     2727    PJ_LOG(4,(THIS_FILE, "Creating playlist with %d file(s)..", file_count)); 
     2728    pj_log_push_indent(); 
    26462729 
    26472730    PJSUA_LOCK(); 
     
    26542737    if (file_id == PJ_ARRAY_SIZE(pjsua_var.player)) { 
    26552738        /* This is unexpected */ 
    2656         PJSUA_UNLOCK(); 
    26572739        pj_assert(0); 
    2658         return PJ_EBUG; 
     2740        status = PJ_EBUG; 
     2741        goto on_error; 
    26592742    } 
    26602743 
     
    26652748    pool = pjsua_pool_create("playlist", 1000, 1000); 
    26662749    if (!pool) { 
    2667         PJSUA_UNLOCK(); 
    2668         return PJ_ENOMEM; 
     2750        status = PJ_ENOMEM; 
     2751        goto on_error; 
    26692752    } 
    26702753 
     
    26732756                                         ptime, options, 0, &port); 
    26742757    if (status != PJ_SUCCESS) { 
    2675         PJSUA_UNLOCK(); 
    26762758        pjsua_perror(THIS_FILE, "Unable to create playlist", status); 
    2677         pj_pool_release(pool); 
    2678         return status; 
     2759        goto on_error; 
    26792760    } 
    26802761 
     
    26832764    if (status != PJ_SUCCESS) { 
    26842765        pjmedia_port_destroy(port); 
    2685         PJSUA_UNLOCK(); 
    26862766        pjsua_perror(THIS_FILE, "Unable to add port", status); 
    2687         pj_pool_release(pool); 
    2688         return status; 
     2767        goto on_error; 
    26892768    } 
    26902769 
     
    26992778 
    27002779    PJSUA_UNLOCK(); 
     2780 
     2781    PJ_LOG(4,(THIS_FILE, "Playlist created, id=%d, slot=%d", file_id, slot)); 
     2782 
     2783    pj_log_pop_indent(); 
     2784 
    27012785    return PJ_SUCCESS; 
    27022786 
     2787on_error: 
     2788    PJSUA_UNLOCK(); 
     2789    if (pool) pj_pool_release(pool); 
     2790    pj_log_pop_indent(); 
     2791 
     2792    return status; 
    27032793} 
    27042794 
     
    27522842    PJ_ASSERT_RETURN(id>=0&&id<(int)PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL); 
    27532843    PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL); 
     2844 
     2845    PJ_LOG(4,(THIS_FILE, "Destroying player %d..", id)); 
     2846    pj_log_push_indent(); 
    27542847 
    27552848    PJSUA_LOCK(); 
     
    27662859 
    27672860    PJSUA_UNLOCK(); 
     2861    pj_log_pop_indent(); 
    27682862 
    27692863    return PJ_SUCCESS; 
     
    27962890    pj_str_t ext; 
    27972891    int file_format; 
    2798     pj_pool_t *pool; 
     2892    pj_pool_t *pool = NULL; 
    27992893    pjmedia_port *port; 
    2800     pj_status_t status; 
     2894    pj_status_t status = PJ_SUCCESS; 
    28012895 
    28022896    /* Filename must present */ 
     
    28092903    PJ_ASSERT_RETURN(enc_type == 0, PJ_EINVAL); 
    28102904 
    2811     if (pjsua_var.rec_cnt >= PJ_ARRAY_SIZE(pjsua_var.recorder)) 
     2905    PJ_LOG(4,(THIS_FILE, "Creating recorder %.*s..", 
     2906              (int)filename->slen, filename->ptr)); 
     2907    pj_log_push_indent(); 
     2908 
     2909    if (pjsua_var.rec_cnt >= PJ_ARRAY_SIZE(pjsua_var.recorder)) { 
     2910        pj_log_pop_indent(); 
    28122911        return PJ_ETOOMANY; 
     2912    } 
    28132913 
    28142914    /* Determine the file format */ 
     
    28242924                             "determine file format for %.*s", 
    28252925                             (int)filename->slen, filename->ptr)); 
     2926        pj_log_pop_indent(); 
    28262927        return PJ_ENOTSUP; 
    28272928    } 
     
    28362937    if (file_id == PJ_ARRAY_SIZE(pjsua_var.recorder)) { 
    28372938        /* This is unexpected */ 
    2838         PJSUA_UNLOCK(); 
    28392939        pj_assert(0); 
    2840         return PJ_EBUG; 
     2940        status = PJ_EBUG; 
     2941        goto on_return; 
    28412942    } 
    28422943 
     
    28462947    pool = pjsua_pool_create(get_basename(path, filename->slen), 1000, 1000); 
    28472948    if (!pool) { 
    2848         PJSUA_UNLOCK(); 
    2849         return PJ_ENOMEM; 
     2949        status = PJ_ENOMEM; 
     2950        goto on_return; 
    28502951    } 
    28512952 
     
    28642965 
    28652966    if (status != PJ_SUCCESS) { 
    2866         PJSUA_UNLOCK(); 
    28672967        pjsua_perror(THIS_FILE, "Unable to open file for recording", status); 
    2868         pj_pool_release(pool); 
    2869         return status; 
     2968        goto on_return; 
    28702969    } 
    28712970 
     
    28742973    if (status != PJ_SUCCESS) { 
    28752974        pjmedia_port_destroy(port); 
    2876         PJSUA_UNLOCK(); 
    2877         pj_pool_release(pool); 
    2878         return status; 
     2975        goto on_return; 
    28792976    } 
    28802977 
     
    28882985 
    28892986    PJSUA_UNLOCK(); 
     2987 
     2988    PJ_LOG(4,(THIS_FILE, "Recorder created, id=%d, slot=%d", file_id, slot)); 
     2989 
     2990    pj_log_pop_indent(); 
    28902991    return PJ_SUCCESS; 
     2992 
     2993on_return: 
     2994    PJSUA_UNLOCK(); 
     2995    if (pool) pj_pool_release(pool); 
     2996    pj_log_pop_indent(); 
     2997    return status; 
    28912998} 
    28922999 
     
    29273034                     PJ_EINVAL); 
    29283035    PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL); 
     3036 
     3037    PJ_LOG(4,(THIS_FILE, "Destroying recorder %d..", id)); 
     3038    pj_log_push_indent(); 
    29293039 
    29303040    PJSUA_LOCK(); 
     
    29413051 
    29423052    PJSUA_UNLOCK(); 
     3053    pj_log_pop_indent(); 
    29433054 
    29443055    return PJ_SUCCESS; 
     
    31483259              param->base.samples_per_frame / param->base.channel_count * 
    31493260              1000 / param->base.clock_rate)); 
     3261    pj_log_push_indent(); 
    31503262 
    31513263    status = pjmedia_snd_port_create2( pjsua_var.snd_pool,  
    31523264                                       param, &pjsua_var.snd_port); 
    31533265    if (status != PJ_SUCCESS) 
    3154         return status; 
     3266        goto on_error; 
    31553267 
    31563268    /* Get the port0 of the conference bridge. */ 
     
    31893301                       errmsg)); 
    31903302            close_snd_dev(); 
    3191             return status; 
     3303            goto on_error; 
    31923304        }  
    31933305             
     
    32183330        pjmedia_snd_port_destroy(pjsua_var.snd_port);     
    32193331        pjsua_var.snd_port = NULL;        
    3220         return status;    
     3332        goto on_error; 
    32213333    } 
    32223334 
     
    32563368        /* Any error is not major, let it through */ 
    32573369        status = PJ_SUCCESS; 
    3258     }; 
     3370    } 
    32593371 
    32603372    /* If this is the first time the audio device is open, retrieve some 
     
    32673379    } 
    32683380 
     3381    pj_log_pop_indent(); 
    32693382    return PJ_SUCCESS; 
     3383 
     3384on_error: 
     3385    pj_log_pop_indent(); 
     3386    return status; 
    32703387} 
    32713388 
     
    32743391static void close_snd_dev(void) 
    32753392{ 
     3393    pj_log_push_indent(); 
     3394 
    32763395    /* Notify app */ 
    32773396    if (pjsua_var.snd_is_on && pjsua_var.ua_cfg.cb.on_snd_dev_operation) { 
     
    33133432    pjsua_var.snd_pool = NULL; 
    33143433    pjsua_var.snd_is_on = PJ_FALSE; 
     3434 
     3435    pj_log_pop_indent(); 
    33153436} 
    33163437 
     
    33283449    pj_status_t status = -1; 
    33293450 
     3451    PJ_LOG(4,(THIS_FILE, "Set sound device: capture=%d, playback=%d", 
     3452              capture_dev, playback_dev)); 
     3453    pj_log_push_indent(); 
     3454 
    33303455    /* Null-sound */ 
    33313456    if (capture_dev==NULL_SND_DEV_ID && playback_dev==NULL_SND_DEV_ID) { 
    3332         return pjsua_set_null_snd_dev(); 
     3457        status = pjsua_set_null_snd_dev(); 
     3458        pj_log_pop_indent(); 
     3459        return status; 
    33333460    } 
    33343461 
     
    33613488                                  samples_per_frame, 16); 
    33623489        if (status != PJ_SUCCESS) 
    3363             return status; 
     3490            goto on_error; 
    33643491 
    33653492        /* Open! */ 
     
    33723499    if (status != PJ_SUCCESS) { 
    33733500        pjsua_perror(THIS_FILE, "Unable to open sound device", status); 
    3374         return status; 
     3501        goto on_error; 
    33753502    } 
    33763503 
     
    33783505    pjsua_var.snd_is_on = PJ_TRUE; 
    33793506 
     3507    pj_log_pop_indent(); 
    33803508    return PJ_SUCCESS; 
     3509 
     3510on_error: 
     3511    pj_log_pop_indent(); 
     3512    return status; 
    33813513} 
    33823514 
     
    34083540    pjmedia_port *conf_port; 
    34093541    pj_status_t status; 
     3542 
     3543    PJ_LOG(4,(THIS_FILE, "Setting null sound device..")); 
     3544    pj_log_push_indent(); 
     3545 
    34103546 
    34113547    /* Close existing sound device */ 
     
    34353571        pjsua_perror(THIS_FILE, "Unable to create null sound device", 
    34363572                     status); 
     3573        pj_log_pop_indent(); 
    34373574        return status; 
    34383575    } 
     
    34483585    pjsua_var.snd_is_on = PJ_TRUE; 
    34493586 
     3587    pj_log_pop_indent(); 
    34503588    return PJ_SUCCESS; 
    34513589} 
Note: See TracChangeset for help on using the changeset viewer.