summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-02-02 02:22:22 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-02-02 02:22:22 +0000
commita7d618cbe67d2c084c80e31a5df21f4fb7221a76 (patch)
treeb004bd27604a9d152e1c74b19bc9f2f0fe1c4f7e /recordmydesktop/src
parentba3672a8bf5245e088176cff2c57b654de1451de (diff)
Fixed bug on >1 channels audio recording with OSS
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@271 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/capture_sound.c2
-rw-r--r--recordmydesktop/src/encode_sound_buffer.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/recordmydesktop/src/capture_sound.c b/recordmydesktop/src/capture_sound.c
index d9ffa91..4314984 100644
--- a/recordmydesktop/src/capture_sound.c
+++ b/recordmydesktop/src/capture_sound.c
@@ -124,7 +124,7 @@ void *CaptureSound(ProgData *pdata){
do{
int temp_sret=read(pdata->sound_handle,
&newbuf->data[sret],
- pdata->args.buffsize);
+ pdata->args.buffsize-sret);
if(temp_sret<0){
fprintf(stderr,"An error occured while reading from soundcard"
"%s\n"
diff --git a/recordmydesktop/src/encode_sound_buffer.c b/recordmydesktop/src/encode_sound_buffer.c
index f20d98e..0e8fa2c 100644
--- a/recordmydesktop/src/encode_sound_buffer.c
+++ b/recordmydesktop/src/encode_sound_buffer.c
@@ -31,7 +31,7 @@ void *EncodeSoundBuffer(ProgData *pdata){
#ifdef HAVE_LIBASOUND
int sampread=pdata->periodsize;
#else
- int sampread=pdata->args.buffsize>>1;
+ int sampread=(pdata->args.buffsize>>1)/pdata->args.channels;
#endif
pdata->v_encoding_clean=0;
while((pdata->running)){
@@ -106,7 +106,8 @@ void SyncEncodeSoundBuffer(ProgData *pdata,signed char *buff){
#ifdef HAVE_LIBASOUND
int sampread=(buff!=NULL)?pdata->periodsize:0;
#else
- int sampread=(buff!=NULL)?(pdata->args.buffsize>>1):0;
+ int sampread=(buff!=NULL)?((pdata->args.buffsize>>1)/
+ pdata->args.channels):0;
#endif
vorbis_buffer=vorbis_analysis_buffer(&pdata->enc_data->m_vo_dsp,sampread);
for(i=0;i<sampread;i++){
© All Rights Reserved