Changeset 4125


Ignore:
Timestamp:
May 17, 2012 3:34:35 AM (12 years ago)
Author:
nanang
Message:

Fix #1510: sharing and assertion problem with native ALSA device.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/alsa_dev.c

    r3553 r4125  
    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) 
     
    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 */ 
     
    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) 
     
    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 */ 
Note: See TracChangeset for help on using the changeset viewer.