--- 3.2.9/ffmpeg.h 2008-01-15 03:03:49.000000000 +0100 +++ 3.2.9-ffmpeg/ffmpeg.h 2008-01-15 03:03:33.000000000 +0100 @@ -2,6 +2,7 @@ #define _INCLUDE_FFMPEG_H_ #ifdef HAVE_FFMPEG +#include #include #endif --- 3.2.9/ffmpeg.c 2008-01-15 03:03:49.000000000 +0100 +++ 3.2.9-ffmpeg/ffmpeg.c 2008-01-15 03:03:33.000000000 +0100 @@ -93,7 +93,7 @@ static int file_open_append(URLContext * fd = open(filename, access_flags, 0666); if (fd < 0) { - return -ENOENT; + return AVERROR(ENOENT); } h->priv_data = (void *)(size_t)fd; return 0; @@ -125,59 +125,58 @@ URLProtocol mpeg1_file_protocol = { static int file_open(URLContext *h, const char *filename, int flags) { - int access; - int fd; + int access_flags, fd; - av_strstart(filename, "file:", &filename); + av_strstart(filename, "file:", &filename); - if (flags & URL_RDWR) { - access = O_CREAT | O_TRUNC | O_RDWR; - } else if (flags & URL_WRONLY) { - access = O_CREAT | O_TRUNC | O_WRONLY; - } else { - access = O_RDONLY; - } + if (flags & URL_RDWR) { + access_flags = O_CREAT | O_TRUNC | O_RDWR; + } else if (flags & URL_WRONLY) { + access_flags = O_CREAT | O_TRUNC | O_WRONLY; + } else { + access_flags = O_RDONLY; + } #ifdef O_BINARY - access |= O_BINARY; + access_flags |= O_BINARY; #endif - fd = open(filename, access, 0666); - if (fd < 0) - return AVERROR(ENOENT); - h->priv_data = (void *)(size_t)fd; - return 0; + fd = open(filename, access_flags, 0666); + if (fd < 0) + return AVERROR(ENOENT); + h->priv_data = (void *)(size_t)fd; + return 0; } static int file_read(URLContext *h, unsigned char *buf, int size) { - int fd = (size_t)h->priv_data; - return read(fd, buf, size); + int fd = (size_t)h->priv_data; + return read(fd, buf, size); } static int file_write(URLContext *h, unsigned char *buf, int size) { - int fd = (size_t)h->priv_data; - return write(fd, buf, size); + int fd = (size_t)h->priv_data; + return write(fd, buf, size); } static offset_t file_seek(URLContext *h, offset_t pos, int whence) { - int fd = (size_t)h->priv_data; - return lseek(fd, pos, whence); + int fd = (size_t)h->priv_data; + return lseek(fd, pos, whence); } static int file_close(URLContext *h) { - int fd = (size_t)h->priv_data; - return close(fd); + int fd = (size_t)h->priv_data; + return close(fd); } URLProtocol file_protocol = { - "file", - file_open, - file_read, - file_write, - file_seek, - file_close, + "file", + file_open, + file_read, + file_write, + file_seek, + file_close, }; #endif