mirror of
https://github.com/mpv-player/mpv
synced 2024-12-26 00:42:57 +00:00
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)
|
||||
{
|
||||
struct priv *p = s->priv;
|
||||
int r = len;
|
||||
int wr;
|
||||
while (r > 0) {
|
||||
wr = write(p->fd, buffer, r);
|
||||
if (wr <= 0)
|
||||
return -1;
|
||||
r -= wr;
|
||||
buffer += wr;
|
||||
}
|
||||
return len - r;
|
||||
return write(p->fd, buffer, len);
|
||||
}
|
||||
|
||||
static int seek(stream_t *s, int64_t newpos)
|
||||
|
Loading…
Reference in New Issue
Block a user