summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-28 22:01:00 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-12-28 22:08:46 +0200
commitd7d8babe61914f14df1fc1bab173574e1fabad1e (patch)
tree565b0e14f85708c929a6c445f7844d86ded0d1fd /libmpcodecs
parent8ee23f418f1e8ea0310f01d4b48c73a693056d87 (diff)
downloadmpv-d7d8babe61914f14df1fc1bab173574e1fabad1e.tar.bz2
mpv-d7d8babe61914f14df1fc1bab173574e1fabad1e.tar.xz
cosmetics: Revert old dec_audio.c code uglification
Revert 3 old code uglification changes that were done with the excuse of gcc-2.95 support. The last reverted change was a fix to a bug introduced in the middle change. Revert "10l, len may change after initialization time" This reverts commit ae9db277c7dae6350cab22d9c57d78cc4684aa9c. Revert "fix declaration after statement, take 2" This reverts commit 4bceedee9305e1ebf53c598eb863aac4153e67d5. Revert "fix declaration after statement" This reverts commit aef0374c1cef269d65b8783dae8d33ee45a1f976.
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/dec_audio.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/libmpcodecs/dec_audio.c b/libmpcodecs/dec_audio.c
index 78dddbf05f..cd63b15b25 100644
--- a/libmpcodecs/dec_audio.c
+++ b/libmpcodecs/dec_audio.c
@@ -352,18 +352,10 @@ int init_audio_filters(sh_audio_t *sh_audio, int in_samplerate,
static int filter_n_bytes(sh_audio_t *sh, int len)
{
- int error = 0;
- // Filter
- af_data_t filter_input = {
- .audio = sh->a_buffer,
- .rate = sh->samplerate,
- .nch = sh->channels,
- .format = sh->sample_format
- };
- af_data_t *filter_output;
-
assert(len-1 + sh->audio_out_minsize <= sh->a_buffer_size);
+ int error = 0;
+
// Decode more bytes if needed
while (sh->a_buffer_len < len) {
unsigned char *buf = sh->a_buffer + sh->a_buffer_len;
@@ -378,9 +370,16 @@ static int filter_n_bytes(sh_audio_t *sh, int len)
sh->a_buffer_len += ret;
}
- filter_input.len = len;
+ // Filter
+ af_data_t filter_input = {
+ .audio = sh->a_buffer,
+ .len = len,
+ .rate = sh->samplerate,
+ .nch = sh->channels,
+ .format = sh->sample_format
+ };
af_fix_parameters(&filter_input);
- filter_output = af_play(sh->afilter, &filter_input);
+ af_data_t *filter_output = af_play(sh->afilter, &filter_input);
if (!filter_output)
return -1;
if (sh->a_out_buffer_size < sh->a_out_buffer_len + filter_output->len) {