mirror of https://github.com/mpv-player/mpv
stream_file: remove unnecessary short write logic
See previous commit.
This commit is contained in:
parent
bec218c4ad
commit
22568fece6
|
@ -123,16 +123,7 @@ static int fill_buffer(stream_t *s, char *buffer, int max_len)
|
||||||
static int write_buffer(stream_t *s, char *buffer, int len)
|
static int write_buffer(stream_t *s, char *buffer, int len)
|
||||||
{
|
{
|
||||||
struct priv *p = s->priv;
|
struct priv *p = s->priv;
|
||||||
int r = len;
|
return write(p->fd, buffer, len);
|
||||||
int wr;
|
|
||||||
while (r > 0) {
|
|
||||||
wr = write(p->fd, buffer, r);
|
|
||||||
if (wr <= 0)
|
|
||||||
return -1;
|
|
||||||
r -= wr;
|
|
||||||
buffer += wr;
|
|
||||||
}
|
|
||||||
return len - r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int seek(stream_t *s, int64_t newpos)
|
static int seek(stream_t *s, int64_t newpos)
|
||||||
|
|
Loading…
Reference in New Issue