From a7d618cbe67d2c084c80e31a5df21f4fb7221a76 Mon Sep 17 00:00:00 2001 From: iovar Date: Fri, 2 Feb 2007 02:22:22 +0000 Subject: 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 --- recordmydesktop/src/encode_sound_buffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'recordmydesktop/src/encode_sound_buffer.c') 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