diff options
author | wm4 <wm4@nowhere> | 2013-03-29 22:52:15 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-13 04:21:29 +0200 |
commit | fd6302631a537f198ba60ae29c8818111881b0b1 (patch) | |
tree | 9e84562f72cf5c9ccea553bdcb1287b383d8abab /audio/filter/af.h | |
parent | d2c20f4cfbfe01bdf63c2a76f20d39212598440e (diff) | |
download | mpv-fd6302631a537f198ba60ae29c8818111881b0b1.tar.bz2 mpv-fd6302631a537f198ba60ae29c8818111881b0b1.tar.xz |
af: streamline format negotiation
Add dummy input and output filters to remove special cases in the format
negotiation code (af_fix_format_conversion() etc.). The output of the
filter chain is now negotiated in exactly the same way as normal
filters.
Negotiate setting the sample rate in the same way as other audio
parameters. As a side effect, the resampler is inserted at the start of
the filter chain instead of the end, but that shouldn't matter much,
especially since conversion and channel mixing are conflated into the
same filter (due to libavresample's API).
Diffstat (limited to 'audio/filter/af.h')
-rw-r--r-- | audio/filter/af.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/audio/filter/af.h b/audio/filter/af.h index bebd21e942..623509c9df 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -91,9 +91,12 @@ struct af_stream { // The first and last filter in the list struct af_instance *first; struct af_instance *last; - // Storage for input and output data formats + // The user sets the input format (what the decoder outputs), and sets some + // or all fields in output to the output format the AO accepts. + // See fixup_output_format(). struct mp_audio input; struct mp_audio output; + struct mp_audio filter_output; // Configuration for this stream struct af_cfg cfg; struct MPOpts *opts; @@ -123,6 +126,9 @@ struct af_stream { * \param s filter chain */ +struct af_stream *af_new(struct MPOpts *opts); +void af_destroy(struct af_stream *s); + /** * \brief Initialize the stream "s". * \return 0 on success, -1 on failure |