From 6bbea44e91dd954a32915f824eaa28dfbf4d97d7 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Wed, 24 Sep 2008 07:21:58 +0200
Subject: output: call send_tag() only if device is on

Why send tags to a device which isn't enabled?
---
 src/audio.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/audio.c b/src/audio.c
index 7917ca526..f3de2285e 100644
--- a/src/audio.c
+++ b/src/audio.c
@@ -396,9 +396,9 @@ void sendMetadataToAudioDevice(const struct tag *tag)
 {
 	unsigned int i;
 
-	for (i = 0; i < audioOutputArraySize; ++i) {
-		audio_output_send_tag(&audioOutputArray[i], tag);
-	}
+	for (i = 0; i < audioOutputArraySize; ++i)
+		if (audioDeviceStates[i] == DEVICE_ON)
+			audio_output_send_tag(&audioOutputArray[i], tag);
 }
 
 int enableAudioDevice(unsigned int device)
-- 
cgit v1.2.3