ffmpeg: simplified mpdurl_read()
The function mpdurl_read() is too complicated, and uses the wrong data types.
This commit is contained in:
parent
964442c5ad
commit
cd7a720426
|
@ -82,22 +82,20 @@ static int mpdurl_open(URLContext *h, const char *filename,
|
||||||
|
|
||||||
static int mpdurl_read(URLContext *h, unsigned char *buf, int size)
|
static int mpdurl_read(URLContext *h, unsigned char *buf, int size)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
FopsHelper *base = (FopsHelper *) h->priv_data;
|
FopsHelper *base = (FopsHelper *) h->priv_data;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
ret = input_stream_read(base->input, (void *)buf, size);
|
size_t ret = input_stream_read(base->input, (void *)buf, size);
|
||||||
if (ret == 0) {
|
if (ret > 0)
|
||||||
if (input_stream_eof(base->input) ||
|
return ret;
|
||||||
(base->decoder &&
|
|
||||||
decoder_get_command(base->decoder) != DECODE_COMMAND_NONE))
|
if (input_stream_eof(base->input) ||
|
||||||
return ret;
|
(base->decoder &&
|
||||||
else
|
decoder_get_command(base->decoder) != DECODE_COMMAND_NONE))
|
||||||
my_usleep(10000);
|
return 0;
|
||||||
} else {
|
|
||||||
break;
|
my_usleep(10000);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int64_t mpdurl_seek(URLContext *h, int64_t pos, int whence)
|
static int64_t mpdurl_seek(URLContext *h, int64_t pos, int whence)
|
||||||
|
|
Loading…
Reference in New Issue