From a109cdbe9f45aff6f9981354c74a6fa2df7b6ebc Mon Sep 17 00:00:00 2001 From: AngelCarpintero Date: Fri, 18 Jan 2008 03:23:33 +0000 Subject: [PATCH] Define AVERROR for ffmpeg 0.4.8 & 0.4.9-pre1 and add a missing motion_log() --- ffmpeg.h | 15 +++++++++++++++ video.c | 1 + 2 files changed, 16 insertions(+) diff --git a/ffmpeg.h b/ffmpeg.h index 36439860..b2d139c0 100644 --- a/ffmpeg.h +++ b/ffmpeg.h @@ -4,8 +4,23 @@ #ifdef HAVE_FFMPEG #include #include + +#ifndef AVERROR /* 0.4.8 & 0.4.9-pre1 */ + +#if EINVAL > 0 +#define AVERROR(e) (-(e)) +#define AVUNERROR(e) (-(e)) +#else +/* Some platforms have E* and errno already negated. */ +#define AVERROR(e) (e) +#define AVUNERROR(e) (e) #endif +#endif /* AVERROR */ + +#endif /* HAVE_FFMPEG */ + + #include #include diff --git a/video.c b/video.c index f04aca05..4f793761 100644 --- a/video.c +++ b/video.c @@ -177,6 +177,7 @@ unsigned char *v4l_start(struct context *cnt, struct video_dev *viddev, int widt } if (MAP_FAILED == map) { + motion_log(LOG_ERR,1,"MAP_FAILED"); return (NULL); } viddev->v4l_curbuffer=0;