Ticket #1510: alsa.patch

File alsa.patch, 2.1 KB (added by bennylp, 12 years ago)
  • pjmedia/src/pjmedia-audiodev/alsa_dev.c

    diff --git a/pjmedia/src/pjmedia-audiodev/alsa_dev.c b/pjmedia/src/pjmedia-audiodev/alsa_dev.c
    index 69e10d0..5bcdedf 100644
    a b static pj_status_t open_playback (struct alsa_stream* stream, 
    547547    int result; 
    548548    unsigned int rate; 
    549549    snd_pcm_uframes_t tmp_buf_size; 
     550    snd_pcm_uframes_t tmp_period_size; 
    550551 
    551552    if (param->play_id < 0 || param->play_id >= stream->af->dev_cnt) 
    552553        return PJMEDIA_EAUD_INVDEV; 
    static pj_status_t open_playback (struct alsa_stream* stream, 
    613614                                            param->channel_count; 
    614615    TRACE_((THIS_FILE, "open_playback: set period size: %d", 
    615616            stream->pb_frames)); 
     617    tmp_period_size = stream->pb_frames; 
    616618    snd_pcm_hw_params_set_period_size_near (stream->pb_pcm, params, 
    617                                             &stream->pb_frames, NULL); 
     619                                            &tmp_period_size, NULL); 
    618620    TRACE_((THIS_FILE, "open_playback: period size set to: %d", 
    619             stream->pb_frames)); 
     621            tmp_period_size)); 
    620622 
    621623    /* Set the sound device buffer size and latency */ 
    622624    if (param->flags & PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY) 
    static pj_status_t open_capture (struct alsa_stream* stream, 
    663665    int result; 
    664666    unsigned int rate; 
    665667    snd_pcm_uframes_t tmp_buf_size; 
     668    snd_pcm_uframes_t tmp_period_size; 
    666669 
    667670    if (param->rec_id < 0 || param->rec_id >= stream->af->dev_cnt) 
    668671        return PJMEDIA_EAUD_INVDEV; 
    static pj_status_t open_capture (struct alsa_stream* stream, 
    729732                                            param->channel_count; 
    730733    TRACE_((THIS_FILE, "open_capture: set period size: %d", 
    731734            stream->ca_frames)); 
     735    tmp_period_size = stream->ca_frames; 
    732736    snd_pcm_hw_params_set_period_size_near (stream->ca_pcm, params, 
    733                                             &stream->ca_frames, NULL); 
     737                                            &tmp_period_size, NULL); 
    734738    TRACE_((THIS_FILE, "open_capture: period size set to: %d", 
    735             stream->ca_frames)); 
     739            tmp_period_size)); 
    736740 
    737741    /* Set the sound device buffer size and latency */ 
    738742    if (param->flags & PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY)