Ticket #504: ticket504.patch

File ticket504.patch, 1.3 KB (added by nanang, 13 years ago)

Fixed assertion param in PortAudio?'s callback implementation

  • pjmedia/src/pjmedia/pasound.c

     
    9090    pjmedia_snd_stream *stream = (pjmedia_snd_stream*) userData; 
    9191    pj_status_t status; 
    9292 
    93     pj_assert(frameCount == stream->samples_per_frame * stream->channel_count); 
     93    pj_assert(frameCount * stream->channel_count == stream->samples_per_frame); 
    9494 
    9595    PJ_UNUSED_ARG(output); 
    9696    PJ_UNUSED_ARG(timeInfo); 
     
    140140    unsigned size = frameCount * stream->bytes_per_sample * 
    141141                    stream->channel_count; 
    142142 
    143     pj_assert(frameCount == stream->samples_per_frame * stream->channel_count); 
     143    pj_assert(frameCount * stream->channel_count == stream->samples_per_frame); 
    144144 
    145145    PJ_UNUSED_ARG(input); 
    146146    PJ_UNUSED_ARG(timeInfo); 
  • pjsip-apps/src/samples/recfile.c

     
    4141 
    4242/* Configs */ 
    4343#define CLOCK_RATE          44100 
    44 #define SAMPLES_PER_FRAME   (CLOCK_RATE * 20 / 1000) 
    4544#define NCHANNELS           2 
     45#define SAMPLES_PER_FRAME   (NCHANNELS * (CLOCK_RATE * 10 / 1000)) 
    4646#define BITS_PER_SAMPLE     16 
    4747 
    4848