mirror of
https://github.com/mpv-player/mpv
synced 2025-01-29 19:22:48 +00:00
af_lavrresample: deprecate this filter
The future direction might be not having such a user-visible filter at all, similar to how vf_scale went away (or actually, redirects to libavfilter's vf_scale).
This commit is contained in:
parent
cbfc001918
commit
a5f53da229
@ -33,6 +33,8 @@ Interface changes
|
||||
its defaults), and various hw deinterlacing filters (like vf_vavpp), for
|
||||
which you will have to stop using --deinterlace=yes, and instead use the
|
||||
vf toggle commands and the filter enable/disable flag to customize it.
|
||||
- deprecate --af=lavrresample. Use the ``--audio-resample-...`` options to
|
||||
customize resampling, or the libavfilter ``--af=aresample`` filter.
|
||||
--- mpv 0.28.0 ---
|
||||
- rename --hwdec=mediacodec option to mediacodec-copy, to reflect
|
||||
conventions followed by other hardware video decoding APIs
|
||||
|
@ -29,6 +29,12 @@ Available filters are:
|
||||
This filter is automatically enabled if the audio output does not support
|
||||
the audio configuration of the file being played.
|
||||
|
||||
.. warning::
|
||||
|
||||
Deprecated. Either use the ``--audio-resample-...`` options to customize
|
||||
resampling, or the libavfilter ``--af=aresample`` filter, which has its
|
||||
own options.
|
||||
|
||||
It supports only the following sample formats: u8, s16, s32, float.
|
||||
|
||||
``filter-size=<length>``
|
||||
|
@ -341,8 +341,9 @@ static int filter_reinit_with_conversion(struct af_stream *s, struct af_instance
|
||||
}
|
||||
if (!mp_audio_config_equals(af->prev->data, &in)) {
|
||||
// Retry with conversion filter added.
|
||||
char *opts[] = {"deprecation-warning", "no", NULL};
|
||||
struct af_instance *new =
|
||||
af_prepend(s, af, "lavrresample", NULL);
|
||||
af_prepend(s, af, "lavrresample", opts);
|
||||
if (!new)
|
||||
return AF_ERROR;
|
||||
new->auto_inserted = true;
|
||||
@ -408,7 +409,8 @@ static int af_do_reinit(struct af_stream *s, bool second_pass)
|
||||
s->first->fmt_in = s->first->fmt_out = s->input;
|
||||
|
||||
if (mp_audio_config_valid(&convert_early)) {
|
||||
struct af_instance *new = af_prepend(s, s->first, "lavrresample", NULL);
|
||||
char *opts[] = {"deprecation-warning", "no", NULL};
|
||||
struct af_instance *new = af_prepend(s, s->first, "lavrresample", opts);
|
||||
if (!new)
|
||||
return AF_ERROR;
|
||||
new->auto_inserted = true;
|
||||
|
@ -45,6 +45,7 @@ struct af_resample {
|
||||
struct mp_resample_opts opts;
|
||||
int global_normalize;
|
||||
struct mp_aconverter *converter;
|
||||
int deprecation_warning;
|
||||
};
|
||||
|
||||
static int control(struct af_instance *af, int cmd, void *arg)
|
||||
@ -149,6 +150,11 @@ static int af_open(struct af_instance *af)
|
||||
|
||||
s->converter = mp_aconverter_create(af->global, af->log, &s->opts);
|
||||
|
||||
if (s->deprecation_warning) {
|
||||
MP_WARN(af, "This filter is deprecated! Use the --audio-resample- options"
|
||||
" to customize resampling, or the --af=aresample filter.\n");
|
||||
}
|
||||
|
||||
return AF_OK;
|
||||
}
|
||||
|
||||
@ -183,6 +189,7 @@ const struct af_info af_info_lavrresample = {
|
||||
.opts = MP_RESAMPLE_OPTS_DEF,
|
||||
.playback_speed = 1.0,
|
||||
.allow_detach = 1,
|
||||
.deprecation_warning = 1,
|
||||
},
|
||||
.options = (const struct m_option[]) {
|
||||
OPT_INTRANGE("filter-size", opts.filter_size, 0, 0, 32),
|
||||
@ -193,6 +200,7 @@ const struct af_info af_info_lavrresample = {
|
||||
OPT_CHOICE("normalize", opts.normalize, 0,
|
||||
({"no", 0}, {"yes", 1}, {"auto", -1})),
|
||||
OPT_KEYVALUELIST("o", opts.avopts, 0),
|
||||
OPT_FLAG("deprecation-warning", deprecation_warning, 0),
|
||||
{0}
|
||||
},
|
||||
.set_defaults = set_defaults,
|
||||
|
@ -110,10 +110,14 @@ static void recreate_speed_filters(struct MPContext *mpctx)
|
||||
return;
|
||||
|
||||
int method = get_speed_method(mpctx);
|
||||
char *filter = method == AF_CONTROL_SET_PLAYBACK_SPEED
|
||||
? "scaletempo" : "lavrresample";
|
||||
char *filter = "lavrresample";
|
||||
char *args[] = {"deprecation-warning", "no", NULL};
|
||||
if (method == AF_CONTROL_SET_PLAYBACK_SPEED) {
|
||||
filter = "scaletempo";
|
||||
args[0] = NULL;
|
||||
}
|
||||
|
||||
if (!af_add(afs, filter, "playback-speed", NULL))
|
||||
if (!af_add(afs, filter, "playback-speed", args))
|
||||
goto fail;
|
||||
|
||||
if (!update_speed_filters(mpctx))
|
||||
|
Loading…
Reference in New Issue
Block a user