diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-16 02:56:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-16 02:56:17 +0100 |
commit | e97a9666ef4511cc34637dc7b064b0a6a4565d0f (patch) | |
tree | df367f3c79346ee993f3d965fe80a71ea9bad4d1 /libavdevice | |
parent | 815daf1607b0dc5e471a0de1132767f60c8a6fd2 (diff) | |
parent | 81ef46020fa654720e3beb4f5551ba634fae262a (diff) | |
download | ffmpeg-streaming-e97a9666ef4511cc34637dc7b064b0a6a4565d0f.zip ffmpeg-streaming-e97a9666ef4511cc34637dc7b064b0a6a4565d0f.tar.gz |
Merge commit '81ef46020fa654720e3beb4f5551ba634fae262a'
* commit '81ef46020fa654720e3beb4f5551ba634fae262a':
bktr: Use av_strerror and propagate error codes
Conflicts:
libavdevice/bktr.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/bktr.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index 6c5a834..c8a8953 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -104,6 +104,8 @@ static av_cold int bktr_init(const char *video_device, int width, int height, char *arg; int c; struct sigaction act = { {0} }, old; + int ret; + char errbuf[128]; if (idev < 0 || idev > 4) { @@ -142,8 +144,10 @@ static av_cold int bktr_init(const char *video_device, int width, int height, *video_fd = avpriv_open(video_device, O_RDONLY); if (*video_fd < 0) { - av_log(NULL, AV_LOG_ERROR, "%s: %s\n", video_device, strerror(errno)); - return -1; + ret = AVERROR(errno); + av_strerror(ret, errbuf, sizeof(errbuf)); + av_log(NULL, AV_LOG_ERROR, "%s: %s\n", video_device, errbuf); + return ret; } geo.rows = height; @@ -165,19 +169,25 @@ static av_cold int bktr_init(const char *video_device, int width, int height, geo.oformat |= METEOR_GEO_EVEN_ONLY; if (ioctl(*video_fd, METEORSETGEO, &geo) < 0) { - av_log(NULL, AV_LOG_ERROR, "METEORSETGEO: %s\n", strerror(errno)); - return -1; + ret = AVERROR(errno); + av_strerror(ret, errbuf, sizeof(errbuf)); + av_log(NULL, AV_LOG_ERROR, "METEORSETGEO: %s\n", errbuf); + return ret; } if (ioctl(*video_fd, BT848SFMT, &c) < 0) { - av_log(NULL, AV_LOG_ERROR, "BT848SFMT: %s\n", strerror(errno)); - return -1; + ret = AVERROR(errno); + av_strerror(ret, errbuf, sizeof(errbuf)); + av_log(NULL, AV_LOG_ERROR, "BT848SFMT: %s\n", errbuf); + return ret; } c = bktr_dev[idev]; if (ioctl(*video_fd, METEORSINPUT, &c) < 0) { - av_log(NULL, AV_LOG_ERROR, "METEORSINPUT: %s\n", strerror(errno)); - return -1; + ret = AVERROR(errno); + av_strerror(ret, errbuf, sizeof(errbuf)); + av_log(NULL, AV_LOG_ERROR, "METEORSINPUT: %s\n", errbuf); + return ret; } video_buf_size = width * height * 12 / 8; @@ -185,8 +195,10 @@ static av_cold int bktr_init(const char *video_device, int width, int height, video_buf = (uint8_t *)mmap((caddr_t)0, video_buf_size, PROT_READ, MAP_SHARED, *video_fd, (off_t)0); if (video_buf == MAP_FAILED) { - av_log(NULL, AV_LOG_ERROR, "mmap: %s\n", strerror(errno)); - return -1; + ret = AVERROR(errno); + av_strerror(ret, errbuf, sizeof(errbuf)); + av_log(NULL, AV_LOG_ERROR, "mmap: %s\n", errbuf); + return ret; } if (frequency != 0.0) { |