From 940ecf5345f339b9d3ec3e8029e345540358fa4c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:14 +0200 Subject: added decoder_read() On our way to stabilize the decoder API, we will one day remove the input stream functions. The most basic function, read() will be provided by decoder_api.h with this patch. It already contains a loop (still with manual polling), error/eof handling and decoder command checks. This kind of code used to be duplicated in all decoder plugins. --- src/inputPlugins/_ogg_common.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/inputPlugins/_ogg_common.c') diff --git a/src/inputPlugins/_ogg_common.c b/src/inputPlugins/_ogg_common.c index 73facdded..535b9a9dc 100644 --- a/src/inputPlugins/_ogg_common.c +++ b/src/inputPlugins/_ogg_common.c @@ -37,15 +37,7 @@ ogg_stream_type ogg_stream_type_detect(InputStream * inStream) seekInputStream(inStream, 0, SEEK_SET); - while (1) { - r = readFromInputStream(inStream, buf, 1, sizeof(buf)); - if (inStream->error) - break; - if (!r && !inputStreamAtEOF(inStream)) - my_usleep(10000); - else - break; - } + r = decoder_read(NULL, inStream, buf, sizeof(buf)); if (r > 0) seekInputStream(inStream, 0, SEEK_SET); -- cgit v1.2.3