From 1dcaf8f76a64fd724c42d54dccfc5eb20ddea98a Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@musicpd.org>
Date: Sat, 7 Jul 2018 13:18:06 +0200
Subject: [PATCH] decoder/audiofile: call TagHandler::OnAudioFormat()

---
 src/decoder/plugins/AudiofileDecoderPlugin.cxx | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/decoder/plugins/AudiofileDecoderPlugin.cxx b/src/decoder/plugins/AudiofileDecoderPlugin.cxx
index 84d40f1d3..64b5e2e88 100644
--- a/src/decoder/plugins/AudiofileDecoderPlugin.cxx
+++ b/src/decoder/plugins/AudiofileDecoderPlugin.cxx
@@ -253,6 +253,13 @@ audiofile_scan_stream(InputStream &is, TagHandler &handler) noexcept
 
 	handler.OnDuration(audiofile_get_duration(fh));
 
+	try {
+		handler.OnAudioFormat(CheckAudioFormat(afGetRate(fh, AF_DEFAULT_TRACK),
+						       audiofile_setup_sample_format(fh),
+						       afGetVirtualChannels(fh, AF_DEFAULT_TRACK)));
+	} catch (...) {
+	}
+
 	return true;
 }