summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-03-07 14:32:29 +0000
committerBenny Prijono <bennylp@teluu.com>2008-03-07 14:32:29 +0000
commitba90068afa793a98c0ec2594565d49f77e79e673 (patch)
treec174a531acbda5fc57fc3e78119b0e87a943ccc4
parent9d25d342f4102e6591ec1ffa003dd65572bbc927 (diff)
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
-rw-r--r--pjmedia/src/pjmedia/pasound.c4
-rw-r--r--pjsip-apps/src/samples/recfile.c2
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