From: divverent Date: Mon, 19 Sep 2011 11:52:52 +0000 (+0000) Subject: video capture: add the missing 32768.0f factor X-Git-Tag: xonotic-v0.6.0~163^2~189 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=167d174d353c234a4f965a0bc1e4478e1a5cff86;p=xonotic%2Fdarkplaces.git video capture: add the missing 32768.0f factor git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11363 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cap_avi.c b/cap_avi.c index e1c0e939..48624364 100644 --- a/cap_avi.c +++ b/cap_avi.c @@ -462,12 +462,12 @@ void SCR_CaptureVideo_Avi_SoundFrame(const portable_sampleframe_t *paintbuffer, { int n0, n1; - n0 = paintbuffer[i].sample[0]; + n0 = paintbuffer[i].sample[0] * 32768.0f; n0 = bound(-32768, n0, 32767); out_ptr[0] = (unsigned char)n0; out_ptr[1] = (unsigned char)(n0 >> 8); - n1 = paintbuffer[i].sample[1]; + n1 = paintbuffer[i].sample[1] * 32768.0f; n1 = bound(-32768, n1, 32767); out_ptr[2] = (unsigned char)n1; out_ptr[3] = (unsigned char)(n1 >> 8); diff --git a/cap_ogg.c b/cap_ogg.c index 609947ca..166ead01 100644 --- a/cap_ogg.c +++ b/cap_ogg.c @@ -919,7 +919,7 @@ static void SCR_CaptureVideo_Ogg_SoundFrame(const portable_sampleframe_t *paintb { float *b = vorbis_buffer[map[j]]; for(i = 0; i < length; ++i) - b[i] = paintbuffer[i].sample[j] / 32768.0f; + b[i] = paintbuffer[i].sample[j]; } qvorbis_analysis_wrote(&format->vd, length);