mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 11:49:48 +00:00
Merge commit 'e05f7ed5436207f4a55f1978b223c7f8bc82af42'
* commit 'e05f7ed5436207f4a55f1978b223c7f8bc82af42': file: properly forward errors from file_read() and file_write() Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
This commit is contained in:
commit
88e7ea3e56
@ -105,19 +105,19 @@ static const AVClass pipe_class = {
|
||||
static int file_read(URLContext *h, unsigned char *buf, int size)
|
||||
{
|
||||
FileContext *c = h->priv_data;
|
||||
int r;
|
||||
int ret;
|
||||
size = FFMIN(size, c->blocksize);
|
||||
r = read(c->fd, buf, size);
|
||||
return (-1 == r)?AVERROR(errno):r;
|
||||
ret = read(c->fd, buf, size);
|
||||
return (ret == -1) ? AVERROR(errno) : ret;
|
||||
}
|
||||
|
||||
static int file_write(URLContext *h, const unsigned char *buf, int size)
|
||||
{
|
||||
FileContext *c = h->priv_data;
|
||||
int r;
|
||||
int ret;
|
||||
size = FFMIN(size, c->blocksize);
|
||||
r = write(c->fd, buf, size);
|
||||
return (-1 == r)?AVERROR(errno):r;
|
||||
ret = write(c->fd, buf, size);
|
||||
return (ret == -1) ? AVERROR(errno) : ret;
|
||||
}
|
||||
|
||||
static int file_get_handle(URLContext *h)
|
||||
|
Loading…
Reference in New Issue
Block a user