output/Source: convert prepared_filter to reference

This commit is contained in:
Max Kellermann 2017-12-27 11:21:43 +01:00
parent 2e0949d8e6
commit 03cf6591c0
3 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,7 @@ AudioFormat
AudioOutputSource::Open(const AudioFormat audio_format, const MusicPipe &_pipe, AudioOutputSource::Open(const AudioFormat audio_format, const MusicPipe &_pipe,
PreparedFilter *prepared_replay_gain_filter, PreparedFilter *prepared_replay_gain_filter,
PreparedFilter *prepared_other_replay_gain_filter, PreparedFilter *prepared_other_replay_gain_filter,
PreparedFilter *prepared_filter) PreparedFilter &prepared_filter)
{ {
assert(audio_format.IsValid()); assert(audio_format.IsValid());
@ -90,7 +90,7 @@ void
AudioOutputSource::OpenFilter(AudioFormat audio_format, AudioOutputSource::OpenFilter(AudioFormat audio_format,
PreparedFilter *prepared_replay_gain_filter, PreparedFilter *prepared_replay_gain_filter,
PreparedFilter *prepared_other_replay_gain_filter, PreparedFilter *prepared_other_replay_gain_filter,
PreparedFilter *prepared_filter) PreparedFilter &prepared_filter)
try { try {
assert(audio_format.IsValid()); assert(audio_format.IsValid());
@ -107,7 +107,7 @@ try {
prepared_other_replay_gain_filter->Open(audio_format); prepared_other_replay_gain_filter->Open(audio_format);
} }
filter_instance = prepared_filter->Open(audio_format); filter_instance = prepared_filter.Open(audio_format);
} catch (...) { } catch (...) {
CloseFilter(); CloseFilter();
throw; throw;

View File

@ -136,7 +136,7 @@ public:
AudioFormat Open(AudioFormat audio_format, const MusicPipe &_pipe, AudioFormat Open(AudioFormat audio_format, const MusicPipe &_pipe,
PreparedFilter *prepared_replay_gain_filter, PreparedFilter *prepared_replay_gain_filter,
PreparedFilter *prepared_other_replay_gain_filter, PreparedFilter *prepared_other_replay_gain_filter,
PreparedFilter *prepared_filter); PreparedFilter &prepared_filter);
void Close() noexcept; void Close() noexcept;
void Cancel() noexcept; void Cancel() noexcept;
@ -195,7 +195,7 @@ private:
void OpenFilter(AudioFormat audio_format, void OpenFilter(AudioFormat audio_format,
PreparedFilter *prepared_replay_gain_filter, PreparedFilter *prepared_replay_gain_filter,
PreparedFilter *prepared_other_replay_gain_filter, PreparedFilter *prepared_other_replay_gain_filter,
PreparedFilter *prepared_filter); PreparedFilter &prepared_filter);
void CloseFilter() noexcept; void CloseFilter() noexcept;

View File

@ -148,7 +148,7 @@ AudioOutputControl::InternalOpen(const AudioFormat in_audio_format,
f = source.Open(in_audio_format, pipe, f = source.Open(in_audio_format, pipe,
output->prepared_replay_gain_filter, output->prepared_replay_gain_filter,
output->prepared_other_replay_gain_filter, output->prepared_other_replay_gain_filter,
output->prepared_filter); *output->prepared_filter);
} catch (...) { } catch (...) {
std::throw_with_nested(FormatRuntimeError("Failed to open filter for %s", std::throw_with_nested(FormatRuntimeError("Failed to open filter for %s",
GetLogName())); GetLogName()));