Browse Source

lavd/fbdev: use av_str2err() macro for printing error messages

In particular fix wrong strerror(ret) with a negative value, and avoid
the use of non thread-safe strerror().
tags/n2.1
Stefano Sabatini 11 years ago
parent
commit
f6b56b1f26
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      libavdevice/fbdev.c

+ 5
- 5
libavdevice/fbdev.c View File

@@ -113,21 +113,21 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
ret = AVERROR(errno); ret = AVERROR(errno);
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"Could not open framebuffer device '%s': %s\n", "Could not open framebuffer device '%s': %s\n",
avctx->filename, strerror(ret));
avctx->filename, av_err2str(ret));
return ret; return ret;
} }


if (ioctl(fbdev->fd, FBIOGET_VSCREENINFO, &fbdev->varinfo) < 0) { if (ioctl(fbdev->fd, FBIOGET_VSCREENINFO, &fbdev->varinfo) < 0) {
ret = AVERROR(errno); ret = AVERROR(errno);
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"FBIOGET_VSCREENINFO: %s\n", strerror(errno));
"FBIOGET_VSCREENINFO: %s\n", av_err2str(ret));
goto fail; goto fail;
} }


if (ioctl(fbdev->fd, FBIOGET_FSCREENINFO, &fbdev->fixinfo) < 0) { if (ioctl(fbdev->fd, FBIOGET_FSCREENINFO, &fbdev->fixinfo) < 0) {
ret = AVERROR(errno); ret = AVERROR(errno);
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"FBIOGET_FSCREENINFO: %s\n", strerror(errno));
"FBIOGET_FSCREENINFO: %s\n", av_err2str(ret));
goto fail; goto fail;
} }


@@ -148,7 +148,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
fbdev->data = mmap(NULL, fbdev->fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->fd, 0); fbdev->data = mmap(NULL, fbdev->fixinfo.smem_len, PROT_READ, MAP_SHARED, fbdev->fd, 0);
if (fbdev->data == MAP_FAILED) { if (fbdev->data == MAP_FAILED) {
ret = AVERROR(errno); ret = AVERROR(errno);
av_log(avctx, AV_LOG_ERROR, "Error in mmap(): %s\n", strerror(errno));
av_log(avctx, AV_LOG_ERROR, "Error in mmap(): %s\n", av_err2str(ret));
goto fail; goto fail;
} }


@@ -209,7 +209,7 @@ static int fbdev_read_packet(AVFormatContext *avctx, AVPacket *pkt)
/* refresh fbdev->varinfo, visible data position may change at each call */ /* refresh fbdev->varinfo, visible data position may change at each call */
if (ioctl(fbdev->fd, FBIOGET_VSCREENINFO, &fbdev->varinfo) < 0) if (ioctl(fbdev->fd, FBIOGET_VSCREENINFO, &fbdev->varinfo) < 0)
av_log(avctx, AV_LOG_WARNING, av_log(avctx, AV_LOG_WARNING,
"Error refreshing variable info: %s\n", strerror(errno));
"Error refreshing variable info: %s\n", av_err2str(ret));


pkt->pts = curtime; pkt->pts = curtime;




Loading…
Cancel
Save