summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-03-22 14:11:43 +0100
committerwm4 <wm4@nowhere>2016-03-22 14:11:43 +0100
commit435cc1b057e2046bac21c1b1942561f5a86a3482 (patch)
treefb9f0084acb99ea859a31f70df8df5d70b421049
parentfd3ae6c561e4e53c994eb802630fef00a2e0a18b (diff)
downloadmpv-435cc1b057e2046bac21c1b1942561f5a86a3482.tar.bz2
mpv-435cc1b057e2046bac21c1b1942561f5a86a3482.tar.xz
af_lavrresample: cosmetics: move code
Preparation for the next commit.
-rw-r--r--audio/filter/af_lavrresample.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/audio/filter/af_lavrresample.c b/audio/filter/af_lavrresample.c
index 6fbb445563..56257edb84 100644
--- a/audio/filter/af_lavrresample.c
+++ b/audio/filter/af_lavrresample.c
@@ -261,18 +261,6 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in,
av_opt_set_double(s->avrctx, "cutoff", s->opts.cutoff, 0);
- int normalize = s->opts.normalize;
- if (normalize < 0)
- normalize = af->opts->audio_normalize;
-#if HAVE_LIBSWRESAMPLE
- av_opt_set_double(s->avrctx, "rematrix_maxval", normalize ? 1 : 1000, 0);
-#else
- av_opt_set_int(s->avrctx, "normalize_mix_level", !!normalize, 0);
-#endif
-
- if (mp_set_avopts(af->log, s->avrctx, s->avopts) < 0)
- goto error;
-
struct mp_chmap map_in = in->channels;
struct mp_chmap map_out = out->channels;
@@ -333,6 +321,18 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in,
out_ch_layout = fudge_layout_conversion(af, in_ch_layout, out_ch_layout);
+ int normalize = s->opts.normalize;
+ if (normalize < 0)
+ normalize = af->opts->audio_normalize;
+#if HAVE_LIBSWRESAMPLE
+ av_opt_set_double(s->avrctx, "rematrix_maxval", normalize ? 1 : 1000, 0);
+#else
+ av_opt_set_int(s->avrctx, "normalize_mix_level", !!normalize, 0);
+#endif
+
+ if (mp_set_avopts(af->log, s->avrctx, s->avopts) < 0)
+ goto error;
+
// Real conversion; output is input to avrctx_out.
av_opt_set_int(s->avrctx, "in_channel_layout", in_ch_layout, 0);
av_opt_set_int(s->avrctx, "out_channel_layout", out_ch_layout, 0);