From c7d1ce07f36186d3f2410ce0fa1ca7c4e7095a8e Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Mon, 30 Jun 2008 02:43:32 +0000
Subject: don't call seekInputStream(0) if r==0

If nothing has been read from the input stream, we don't have to
rewind it.

git-svn-id: https://svn.musicpd.org/mpd/trunk@7397 09075e82-0dd4-0310-85a5-a0d7c8717e4f
---
 src/inputPlugins/_ogg_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/inputPlugins/_ogg_common.c b/src/inputPlugins/_ogg_common.c
index b0a9900a6..d24b2b47b 100644
--- a/src/inputPlugins/_ogg_common.c
+++ b/src/inputPlugins/_ogg_common.c
@@ -50,7 +50,8 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream)
 			break;
 	}
 
-	seekInputStream(inStream, 0, SEEK_SET);
+	if (r > 0)
+		seekInputStream(inStream, 0, SEEK_SET);
 
 	if (r >= 32 && memcmp(buf, "OggS", 4) == 0 && (
 				(memcmp(buf+29, "FLAC", 4) == 0
-- 
cgit v1.2.3