aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-04 16:55:12 +0100
committerMax Kellermann <max@duempel.org>2008-11-04 16:55:12 +0100
commitab07cdd453ae4a7570d827b0916106bf3a41af85 (patch)
tree22c631b07073e6e83615e013d7882110ac3cbb45
parent292334a27a4327ada969d2cbe390e86cb3193c9d (diff)
downloadmpd-ab07cdd453ae4a7570d827b0916106bf3a41af85.tar.gz
mpd-ab07cdd453ae4a7570d827b0916106bf3a41af85.tar.xz
mpd-ab07cdd453ae4a7570d827b0916106bf3a41af85.zip
ffmpeg: removed loop from mpd_ffmpeg_read()
The function decoder_read() already cares about the decoder command, and loops until data is available. Reduced mpd_ffmpeg_read() to no more than the decoder_read() call.
Diffstat (limited to '')
-rw-r--r--src/decoder/ffmpeg_plugin.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/decoder/ffmpeg_plugin.c b/src/decoder/ffmpeg_plugin.c
index 63d158349..19faeb1cd 100644
--- a/src/decoder/ffmpeg_plugin.c
+++ b/src/decoder/ffmpeg_plugin.c
@@ -18,8 +18,6 @@
#include "../decoder_api.h"
#include "../log.h"
-#include "../utils.h"
-#include "../log.h"
#include <assert.h>
#include <stdio.h>
@@ -84,19 +82,8 @@ static int mpd_ffmpeg_read(URLContext *h, unsigned char *buf, int size)
{
struct ffmpeg_stream *stream = (struct ffmpeg_stream *) h->priv_data;
- while (true) {
- size_t ret = decoder_read(stream->decoder, stream->input,
- (void *)buf, size);
- if (ret > 0)
- return ret;
-
- if (input_stream_eof(stream->input) ||
- (stream->decoder &&
- decoder_get_command(stream->decoder) != DECODE_COMMAND_NONE))
- return 0;
-
- my_usleep(10000);
- }
+ return decoder_read(stream->decoder, stream->input,
+ (void *)buf, size);
}
static int64_t mpd_ffmpeg_seek(URLContext *h, int64_t pos, int whence)