1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-26 09:02:38 +00:00

af_rubberband: add new engine option in rubberband 3.0.0

This commit is contained in:
Christoph Heinrich 2022-07-16 03:17:41 +02:00 committed by Dudemanguy
parent ae768a1e14
commit 490e263529
4 changed files with 22 additions and 2 deletions

View File

@ -43,6 +43,8 @@ Interface changes
- add `film-grain` sub-parameter to `format` video filter
- add experimental `--vo=vaapi-wayland` video output driver
- add `--x11-present` for controlling whether to use xorg's present extension
- add `engine` option to the `rubberband` audio filter to support the new
engine introduced in rubberband 3.0.0. Defaults to `finer` (new engine).
--- mpv 0.34.0 ---
- deprecate selecting by card number with `--drm-connector`, add
`--drm-device` which can be used instead

View File

@ -20,6 +20,8 @@
#include <rubberband/rubberband-c.h>
#include "config.h"
#include "audio/aframe.h"
#include "audio/format.h"
#include "common/common.h"
@ -31,7 +33,7 @@
// command line options
struct f_opts {
int transients, detector, phase, window,
smoothing, formant, pitch, channels;
smoothing, formant, pitch, channels, engine;
double scale;
};
@ -78,7 +80,10 @@ static bool init_rubberband(struct mp_filter *f)
int opts = p->opts->transients | p->opts->detector | p->opts->phase |
p->opts->window | p->opts->smoothing | p->opts->formant |
p->opts->pitch | p-> opts->channels |
p->opts->pitch | p->opts->channels |
#if HAVE_RUBBERBAND_3
p->opts->engine |
#endif
RubberBandOptionProcessRealTime;
int rate = mp_aframe_get_rate(p->pending);
@ -331,6 +336,9 @@ const struct mp_user_filter_entry af_rubberband = {
.transients = RubberBandOptionTransientsMixed,
.formant = RubberBandOptionFormantPreserved,
.channels = RubberBandOptionChannelsTogether,
#if HAVE_RUBBERBAND_3
.engine = RubberBandOptionEngineFiner,
#endif
},
.options = (const struct m_option[]) {
{"transients", OPT_CHOICE(transients,
@ -361,6 +369,11 @@ const struct mp_user_filter_entry af_rubberband = {
{"channels", OPT_CHOICE(channels,
{"apart", RubberBandOptionChannelsApart},
{"together", RubberBandOptionChannelsTogether})},
#if HAVE_RUBBERBAND_3
{"engine", OPT_CHOICE(engine,
{"finer", RubberBandOptionEngineFiner},
{"faster", RubberBandOptionEngineFaster})},
#endif
{"pitch-scale", OPT_DOUBLE(scale), M_RANGE(0.01, 100)},
{0}
},

View File

@ -1774,6 +1774,7 @@ conf_data.set10('HAVE_PULSE', pulse.found())
conf_data.set10('HAVE_RPI', rpi['use'])
conf_data.set10('HAVE_RPI_MMAL', rpi_mmal.found())
conf_data.set10('HAVE_RUBBERBAND', rubberband.found())
conf_data.set10('HAVE_RUBBERBAND_3', rubberband.version().version_compare('>= 3.0.0'))
conf_data.set10('HAVE_SDL2', sdl2.found())
conf_data.set10('HAVE_SDL2_AUDIO', sdl2_audio.allowed())
conf_data.set10('HAVE_SDL2_GAMEPAD', sdl2_gamepad.allowed())

View File

@ -395,6 +395,10 @@ iconv support use --disable-iconv.",
'name': 'jpegxl',
'desc': 'JPEG XL support via libavcodec',
'func': check_pkg_config('libavcodec >= 59.27.100'),
}, {
'name': 'rubberband-3',
'desc': 'new engine support for librubberband',
'func': check_pkg_config('rubberband >= 3.0.0'),
}
]