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:
@ -105,19 +105,19 @@ static const AVClass pipe_class = {
|
|||||||
static int file_read(URLContext *h, unsigned char *buf, int size)
|
static int file_read(URLContext *h, unsigned char *buf, int size)
|
||||||
{
|
{
|
||||||
FileContext *c = h->priv_data;
|
FileContext *c = h->priv_data;
|
||||||
int r;
|
int ret;
|
||||||
size = FFMIN(size, c->blocksize);
|
size = FFMIN(size, c->blocksize);
|
||||||
r = read(c->fd, buf, size);
|
ret = read(c->fd, buf, size);
|
||||||
return (-1 == r)?AVERROR(errno):r;
|
return (ret == -1) ? AVERROR(errno) : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_write(URLContext *h, const unsigned char *buf, int size)
|
static int file_write(URLContext *h, const unsigned char *buf, int size)
|
||||||
{
|
{
|
||||||
FileContext *c = h->priv_data;
|
FileContext *c = h->priv_data;
|
||||||
int r;
|
int ret;
|
||||||
size = FFMIN(size, c->blocksize);
|
size = FFMIN(size, c->blocksize);
|
||||||
r = write(c->fd, buf, size);
|
ret = write(c->fd, buf, size);
|
||||||
return (-1 == r)?AVERROR(errno):r;
|
return (ret == -1) ? AVERROR(errno) : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int file_get_handle(URLContext *h)
|
static int file_get_handle(URLContext *h)
|
||||||
|
Reference in New Issue
Block a user