mirror of https://github.com/mpv-player/mpv
stream_smb: remove unnecessary short write logic
See previous commit. It compiles, but 100% untested.
This commit is contained in:
parent
22568fece6
commit
116ab73566
|
@ -85,18 +85,11 @@ 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;
|
|
||||||
int wr;
|
int wr;
|
||||||
while (r > 0) {
|
pthread_mutex_lock(&smb_lock);
|
||||||
pthread_mutex_lock(&smb_lock);
|
wr = smbc_write(p->fd,buffer,len);
|
||||||
wr = smbc_write(p->fd,buffer,r);
|
pthread_mutex_unlock(&smb_lock);
|
||||||
pthread_mutex_unlock(&smb_lock);
|
return wr;
|
||||||
if (wr <= 0)
|
|
||||||
return -1;
|
|
||||||
r -= wr;
|
|
||||||
buffer += wr;
|
|
||||||
}
|
|
||||||
return len - r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void close_f(stream_t *s){
|
static void close_f(stream_t *s){
|
||||||
|
|
Loading…
Reference in New Issue