diff options
author | wm4 <wm4@nowhere> | 2018-02-01 08:39:07 +0100 |
---|---|---|
committer | Kevin Mitchell <kevmitch@gmail.com> | 2018-02-03 05:01:29 -0800 |
commit | 7019e0dcfe9f6edddfe8b20f062f8bb94110b3a0 (patch) | |
tree | 899fa5381652a5b3ace5478a57935bff7772dfdd /filters/f_swresample.h | |
parent | 171ec0a7e40030f599b7b385b3699835e8c1eb2d (diff) | |
download | mpv-7019e0dcfe9f6edddfe8b20f062f8bb94110b3a0.tar.bz2 mpv-7019e0dcfe9f6edddfe8b20f062f8bb94110b3a0.tar.xz |
swresample: limit output size of audio frames
Similar to the previous commit, and for the same reasons. Unlike with
af_scaletempo, resampling does not have a natural frame size, so we set
an arbitrary size limit on output frames. We add a new option to control
this size, although I'm not sure whether anyone will use it, so mark it
for testing only.
Note that we go through some effort to avoid buffering data in
libswresample itself. One reason is that we might have to reinitialize
the resampler completely when changing speed, which drops the buffered
data. Another is that I'm not sure whether the resampler will do the
right thing when applying dynamic speed changes.
Diffstat (limited to 'filters/f_swresample.h')
-rw-r--r-- | filters/f_swresample.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/filters/f_swresample.h b/filters/f_swresample.h index 44b2e35d08..10d6176a56 100644 --- a/filters/f_swresample.h +++ b/filters/f_swresample.h @@ -23,6 +23,7 @@ struct mp_resample_opts { double cutoff; int normalize; int allow_passthrough; + double max_output_frame_size; char **avopts; }; @@ -31,6 +32,7 @@ struct mp_resample_opts { .cutoff = 0.0, \ .phase_shift = 10, \ .normalize = 0, \ + .max_output_frame_size = 40,\ } // Create the filter. If opts==NULL, use the global options as defaults. |