<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>mencoder_vol.patch</title>
<meta name="Generator" content="Vim/8.1">
<meta name="plugin-version" content="vim8.1_v1">
<meta name="syntax" content="diff">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="default">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #ffffff; background-color: #000000; }
body { font-family: monospace; color: #ffffff; background-color: #000000; }
* { font-size: 1em; }
.Identifier { color: #00ffff; }
.Statement { color: #ffff00; }
.Type { color: #00ff00; }
-->
</style>
</head>
<body>
<pre id='vimCodeElement'>
<span class="Type">--- mplayer.old/mencoder.c 2012-07-17 16:40:51.879232768 +0200</span>
<span class="Type">+++ mplayer/mencoder.c 2012-07-17 16:48:56.351199711 +0200</span>
<span class="Statement">@@ -1328,6 +1328,20 @@</span>
len = aencoder->decode_buffer_size;
len = dec_audio(sh_audio, aencoder->decode_buffer, len);
<span class="Identifier">+#define TEST_VOLUME</span>
<span class="Identifier">+#ifdef TEST_VOLUME</span>
<span class="Identifier">+ static short testv_max = 0;</span>
<span class="Identifier">+ short* testv_in_buffer = mux_a->buffer;</span>
<span class="Identifier">+ int testv_nsamples = len/2;</span>
<span class="Identifier">+ int testv_i;</span>
<span class="Identifier">+ for (testv_i=0; testv_i<testv_nsamples; ++testv_i) {</span>
<span class="Identifier">+ if (abs(testv_in_buffer[testv_i]) > testv_max) {</span>
<span class="Identifier">+ testv_max = abs(testv_in_buffer[testv_i]);</span>
<span class="Identifier">+ printf("volume max=%d volume gain=%f\n",</span>
<span class="Identifier">+ testv_max,32767.0/testv_max);</span>
<span class="Identifier">+ }</span>
<span class="Identifier">+ }</span>
<span class="Identifier">+#endif</span>
mux_a->buffer_len += aencoder->encode(aencoder, mux_a->buffer + mux_a->buffer_len,
aencoder->decode_buffer, len, mux_a->buffer_size-mux_a->buffer_len);
if(mux_a->buffer_len < mux_a->wf->nBlockAlign)
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->