From ba90068afa793a98c0ec2594565d49f77e79e673 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 7 Mar 2008 14:32:29 +0000 Subject: Ticket #504: assertion in sound device and recfile sample when using stereo git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1848 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia/pasound.c | 4 ++-- pjsip-apps/src/samples/recfile.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pjmedia/src/pjmedia/pasound.c b/pjmedia/src/pjmedia/pasound.c index cd28b26b..78f4778c 100644 --- a/pjmedia/src/pjmedia/pasound.c +++ b/pjmedia/src/pjmedia/pasound.c @@ -90,7 +90,7 @@ static int PaRecorderCallback(const void *input, pjmedia_snd_stream *stream = (pjmedia_snd_stream*) userData; pj_status_t status; - pj_assert(frameCount == stream->samples_per_frame * stream->channel_count); + pj_assert(frameCount * stream->channel_count == stream->samples_per_frame); PJ_UNUSED_ARG(output); PJ_UNUSED_ARG(timeInfo); @@ -140,7 +140,7 @@ static int PaPlayerCallback( const void *input, unsigned size = frameCount * stream->bytes_per_sample * stream->channel_count; - pj_assert(frameCount == stream->samples_per_frame * stream->channel_count); + pj_assert(frameCount * stream->channel_count == stream->samples_per_frame); PJ_UNUSED_ARG(input); PJ_UNUSED_ARG(timeInfo); diff --git a/pjsip-apps/src/samples/recfile.c b/pjsip-apps/src/samples/recfile.c index 1fc68b06..7e8563d3 100644 --- a/pjsip-apps/src/samples/recfile.c +++ b/pjsip-apps/src/samples/recfile.c @@ -41,8 +41,8 @@ /* Configs */ #define CLOCK_RATE 44100 -#define SAMPLES_PER_FRAME (CLOCK_RATE * 20 / 1000) #define NCHANNELS 2 +#define SAMPLES_PER_FRAME (NCHANNELS * (CLOCK_RATE * 10 / 1000)) #define BITS_PER_SAMPLE 16 -- cgit v1.2.3