diff options
author | Luca Abeni <lucabe72@email.it> | 2007-11-19 07:54:04 +0000 |
---|---|---|
committer | Luca Abeni <lucabe72@email.it> | 2007-11-19 07:54:04 +0000 |
commit | 9f74582cea3fd626737cd6785f8ae1da2491fab5 (patch) | |
tree | ccae6223d8b2d5ebafadddde6b70bbcaf8bf4aca /libavformat/dv1394.c | |
parent | 7f0cd6a5293ff7608b3725f4dcc6ad141030cc4f (diff) | |
download | ffmpeg-9f74582cea3fd626737cd6785f8ae1da2491fab5.tar.gz |
Do not use perror() in audio, video, and DV grabbers
Originally committed as revision 11058 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dv1394.c')
-rw-r--r-- | libavformat/dv1394.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavformat/dv1394.c b/libavformat/dv1394.c index 93e08ee6e2..8e2e2f607c 100644 --- a/libavformat/dv1394.c +++ b/libavformat/dv1394.c @@ -74,7 +74,7 @@ static int dv1394_start(struct dv1394_data *dv) { /* Tell DV1394 driver to enable receiver */ if (ioctl(dv->fd, DV1394_START_RECEIVE, 0) < 0) { - perror("Failed to start receiver"); + av_log(NULL, AV_LOG_ERROR, "Failed to start receiver: %s\n", strerror(errno)); return -1; } return 0; @@ -101,19 +101,19 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap /* Open and initialize DV1394 device */ dv->fd = open(context->filename, O_RDONLY); if (dv->fd < 0) { - perror("Failed to open DV interface"); + av_log(context, AV_LOG_ERROR, "Failed to open DV interface: %s\n", strerror(errno)); goto failed; } if (dv1394_reset(dv) < 0) { - perror("Failed to initialize DV interface"); + av_log(context, AV_LOG_ERROR, "Failed to initialize DV interface: %s\n", strerror(errno)); goto failed; } dv->ring = mmap(NULL, DV1394_PAL_FRAME_SIZE * DV1394_RING_FRAMES, PROT_READ, MAP_PRIVATE, dv->fd, 0); if (dv->ring == MAP_FAILED) { - perror("Failed to mmap DV ring buffer"); + av_log(context, AV_LOG_ERROR, "Failed to mmap DV ring buffer: %s\n", strerror(errno)); goto failed; } @@ -162,12 +162,12 @@ restart_poll: if (poll(&p, 1, -1) < 0) { if (errno == EAGAIN || errno == EINTR) goto restart_poll; - perror("Poll failed"); + av_log(context, AV_LOG_ERROR, "Poll failed: %s\n", strerror(errno)); return AVERROR(EIO); } if (ioctl(dv->fd, DV1394_GET_STATUS, &s) < 0) { - perror("Failed to get status"); + av_log(context, AV_LOG_ERROR, "Failed to get status: %s\n", strerror(errno)); return AVERROR(EIO); } #ifdef DV1394_DEBUG @@ -213,11 +213,11 @@ static int dv1394_close(AVFormatContext * context) /* Shutdown DV1394 receiver */ if (ioctl(dv->fd, DV1394_SHUTDOWN, 0) < 0) - perror("Failed to shutdown DV1394"); + av_log(context, AV_LOG_ERROR, "Failed to shutdown DV1394: %s\n", strerror(errno)); /* Unmap ring buffer */ if (munmap(dv->ring, DV1394_NTSC_FRAME_SIZE * DV1394_RING_FRAMES) < 0) - perror("Failed to munmap DV1394 ring buffer"); + av_log(context, AV_LOG_ERROR, "Failed to munmap DV1394 ring buffer: %s\n", strerror(errno)); close(dv->fd); av_free(dv->dv_demux); |