summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-26 14:18:48 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-01-25 17:00:14 +0900
commit9f4d44f8c7060562958b3b049e169e0a30d13946 (patch)
tree5bfdcd0a18b83186bc97bc55bcdf335a3f06bbb0
parentd60940a0809e0384d3ebe69e7fde2db490bed639 (diff)
downloadmpv-9f4d44f8c7060562958b3b049e169e0a30d13946.tar.bz2
mpv-9f4d44f8c7060562958b3b049e169e0a30d13946.tar.xz
stream_pvr: increase timeout, slightly better error reporting
An attempt to find out what's wrong with issue #1382. I don't even know why a timeout would be needed; for robustness with broken devices maybe?
-rw-r--r--stream/stream_pvr.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/stream/stream_pvr.c b/stream/stream_pvr.c
index c75a9597cd..7acac4a6f5 100644
--- a/stream/stream_pvr.c
+++ b/stream/stream_pvr.c
@@ -537,8 +537,8 @@ get_v4l2_freq (struct pvr_t *pvr)
if (ioctl (pvr->dev_fd, VIDIOC_G_FREQUENCY, &vf) < 0)
{
- MP_ERR(pvr, "%s can't get frequency %d.\n",
- LOG_LEVEL_V4L2, errno);
+ MP_ERR(pvr, "%s can't get frequency (%s).\n",
+ LOG_LEVEL_V4L2, mp_strerror(errno));
return -1;
}
freq = vf.frequency;
@@ -1491,10 +1491,15 @@ pvr_stream_read (stream_t *stream, char *buffer, int size)
rk = size - pos;
- if (poll (pfds, 1, 500) <= 0)
+ int r = poll(pfds, 1, 5000);
+ if (r <= 0)
{
- MP_ERR(pvr, "%s failed with errno %d when reading %d bytes\n",
- LOG_LEVEL_PVR, errno, size-pos);
+ if (r < 0) {
+ MP_ERR(pvr, "%s failed with '%s' when reading %d bytes\n",
+ LOG_LEVEL_PVR, mp_strerror(errno), size-pos);
+ } else {
+ MP_ERR(pvr, "timeout when trying to read from device\n");
+ }
break;
}