From 1a3945b56331fc899c8c1a5e1e39af348fd9b4eb Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Thu, 13 Nov 2008 02:42:40 +0100
Subject: [PATCH] decoder: check dc.command at the beginning of decoder_data()

Seeking was somewhat broken in some decoder plugins because they sent
empty chunks, and never got a command.  Check the decoder command
before doing anything else in decoder_data().
---
 src/decoder_api.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/decoder_api.c b/src/decoder_api.c
index 1db6797a8..c8a13709c 100644
--- a/src/decoder_api.c
+++ b/src/decoder_api.c
@@ -187,6 +187,10 @@ decoder_data(struct decoder *decoder,
 
 	assert(dc.state == DECODE_STATE_DECODE);
 
+	if (dc.command == DECODE_COMMAND_STOP ||
+	    dc.command == DECODE_COMMAND_SEEK)
+		return dc.command;
+
 	if (is != NULL && !decoder->stream_tag_sent) {
 		const struct tag *src;
 		struct tag *tag1, *tag2;
-- 
2.24.1