X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=snd_mix.c;h=38e6253a24f3a89bdb07ffb65bd0b1eaeed226cd;hb=a1fd1fce6da4c9bc532bb724b2eaaa754bbc3c21;hp=4f3310bfcf1a83b3ef3eaad472b70fa7e850ceae;hpb=cfee52a1ec9db338098789cae89ae5cf1f7a6fbf;p=xonotic%2Fdarkplaces.git diff --git a/snd_mix.c b/snd_mix.c index 4f3310bf..38e6253a 100644 --- a/snd_mix.c +++ b/snd_mix.c @@ -28,6 +28,7 @@ static portable_sampleframe_t paintbuffer_unswapped[PAINTBUFFER_SIZE]; extern speakerlayout_t snd_speakerlayout; // for querying the listeners +#ifdef CONFIG_VIDEO_CAPTURE static void S_CaptureAVISound(const portable_sampleframe_t *paintbuffer, size_t length) { size_t i; @@ -46,6 +47,7 @@ static void S_CaptureAVISound(const portable_sampleframe_t *paintbuffer, size_t SCR_CaptureVideo_SoundFrame(paintbuffer_unswapped, length); } +#endif extern cvar_t snd_softclip; @@ -301,7 +303,7 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) // paint in the channels. // channels with zero volumes still advance in time but don't paint. - ch = channels; + ch = channels; // cppcheck complains here but it is wrong, channels is a channel_t[MAX_CHANNELS] and not an int for (channelindex = 0;channelindex < (int)total_channels;channelindex++, ch++) { sfx = ch->sfx; @@ -360,7 +362,6 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) // do the actual paint now (may skip work if silent) paint = paintbuffer; - wantframes = totalmixframes; istartframe = 0; for (wantframes = totalmixframes;wantframes > 0;posd += count * speedd, wantframes -= count) { @@ -521,8 +522,10 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes) S_SoftClipPaintBuffer(paintbuffer, totalmixframes, snd_renderbuffer->format.width, snd_renderbuffer->format.channels); +#ifdef CONFIG_VIDEO_CAPTURE if (!snd_usethreadedmixing) S_CaptureAVISound(paintbuffer, totalmixframes); +#endif S_ConvertPaintBuffer(paintbuffer, outbytes, totalmixframes, snd_renderbuffer->format.width, snd_renderbuffer->format.channels);