From 7dd3822d099522cd8bf59aa1eb3e318e2cfcacdd Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 2 Oct 2014 01:47:27 +0200 Subject: 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. --- audio/filter/af.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio/filter/af.h') 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; -- cgit v1.2.3