diff options
author | wm4 <wm4@nowhere> | 2013-03-23 13:02:59 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-13 04:21:27 +0200 |
commit | 5a958921a738f2cd928f8339872b74a3c299ff0e (patch) | |
tree | 751da3be0e1b48f987cc3f38d30f381b34e38ee6 /audio/filter/af.h | |
parent | 0a136ece5aa6c3004cc6e7b778f889fb6aa82633 (diff) | |
download | mpv-5a958921a738f2cd928f8339872b74a3c299ff0e.tar.bz2 mpv-5a958921a738f2cd928f8339872b74a3c299ff0e.tar.xz |
af: remove automatically inserted filters on full reinit
Make sure automatically inserted filters are removed on full reinit
(they are re-added later if they are really needed). Automatically
inserted filters were never explicitly removed, instead, it was
expected that redundant conversion filters detach themselves. This
didn't work if there were several chained format conversion filters,
e.g. s16le->floatle->s16le, which could result from repeated filter
insertion and removal. (format filters detach only if input format and
output format are the same.)
Further, the dummy filter (which exists only because af.c can't handle
an empty filter chain for some reason) could introduce bad conversions
due to how the format negotiation works. Change the code so that the
dummy filter never takes part on format negotiation. (It would be better
to fix format negotiation, but that would be much more complicated and
would involving fixing all filters.)
Simplify af_reinit() and remove the start audio filter parameter. This
means format negotiation and filter initialization is run more often,
but should be harmless.
Diffstat (limited to 'audio/filter/af.h')
-rw-r--r-- | audio/filter/af.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/audio/filter/af.h b/audio/filter/af.h index 71892aa144..e4a329abea 100644 --- a/audio/filter/af.h +++ b/audio/filter/af.h @@ -20,6 +20,7 @@ #define MPLAYER_AF_H #include <stdio.h> +#include <stdbool.h> #include "config.h" @@ -75,6 +76,7 @@ struct af_instance { * corresponding output */ double mul; /* length multiplier: how much does this instance change the length of the buffer. */ + bool auto_inserted; // inserted by af.c, such as conversion filters }; // Initialization flags @@ -161,10 +163,10 @@ void af_uninit(struct af_stream *s); /** * \brief Reinit the filter list from the given filter on downwards - * \param Filter instance to begin the reinit from + * See af.c. * \return AF_OK on success or AF_ERROR on failure */ -int af_reinit(struct af_stream *s, struct af_instance *af); +int af_reinit(struct af_stream *s); /** * \brief This function adds the filter "name" to the stream s. |