summaryrefslogtreecommitdiffstats
path: root/audio/filter/af.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-02 01:47:27 +0200
committerwm4 <wm4@nowhere>2014-10-02 02:42:23 +0200
commit7dd3822d099522cd8bf59aa1eb3e318e2cfcacdd (patch)
tree2167d50000fe2d52f23c468595c8c6b887b09a29 /audio/filter/af.h
parent2e16dfbf93bd9348c4beb526b14f52b01af3e867 (diff)
downloadmpv-7dd3822d099522cd8bf59aa1eb3e318e2cfcacdd.tar.bz2
mpv-7dd3822d099522cd8bf59aa1eb3e318e2cfcacdd.tar.xz
audio: refactor some aspects of filter chain setup
There's no real reason why audio_init_filter() should exist. Just use af_init or af_reinit directly. (We lose a useless message; the same information is printed in a quite close place with more details.) Requires less code, and the way the filter chain is marked as having failed to initialize allows just switching off audio instead of crashing if trying to insert a volume filter in mixer.c fails, and recreating the old filter chain fails too.
Diffstat (limited to 'audio/filter/af.h')
-rw-r--r--audio/filter/af.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/audio/filter/af.h b/audio/filter/af.h
index bec0e823fe..579ac271ef 100644
--- a/audio/filter/af.h
+++ b/audio/filter/af.h
@@ -80,6 +80,8 @@ struct af_instance {
// Current audio stream
struct af_stream {
+ int initialized; // 0: no, 1: yes, -1: attempted to, but failed
+
// The first and last filter in the list
struct af_instance *first;
struct af_instance *last;