diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 14:40:29 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-20 14:40:29 +0000 |
commit | 240ee4015c68678480c86f94d8642b7e8b5fd401 (patch) | |
tree | c7f9ed13e51e9ff53b9488f614604137339c5933 /media/ffmpeg | |
parent | ef29778ad0b2f9f4ba7ec1286999784518746a45 (diff) | |
download | chromium_src-240ee4015c68678480c86f94d8642b7e8b5fd401.zip chromium_src-240ee4015c68678480c86f94d8642b7e8b5fd401.tar.gz chromium_src-240ee4015c68678480c86f94d8642b7e8b5fd401.tar.bz2 |
Handle EINTR and remove offset_t in ffmpeg code.
(Should also fix OpenBSD build I believe)
http://codereview.chromium.org/2136017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/ffmpeg')
-rw-r--r-- | media/ffmpeg/ffmpeg_common.h | 3 | ||||
-rw-r--r-- | media/ffmpeg/file_protocol.cc | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/media/ffmpeg/ffmpeg_common.h b/media/ffmpeg/ffmpeg_common.h index 555eb9a..10f67d2 100644 --- a/media/ffmpeg/ffmpeg_common.h +++ b/media/ffmpeg/ffmpeg_common.h @@ -11,9 +11,6 @@ #include "base/compiler_specific.h" #include "base/singleton.h" -// Used with URLProtocol. -typedef int64 offset_t; - // Include FFmpeg header files. extern "C" { // Temporarily disable possible loss of data warning. diff --git a/media/ffmpeg/file_protocol.cc b/media/ffmpeg/file_protocol.cc index 2d1bd1d..eb82d35 100644 --- a/media/ffmpeg/file_protocol.cc +++ b/media/ffmpeg/file_protocol.cc @@ -14,6 +14,7 @@ #include <fcntl.h> #include "base/compiler_specific.h" +#include "base/eintr_wrapper.h" #include "base/file_util.h" #include "base/logging.h" #include "media/ffmpeg/ffmpeg_common.h" @@ -47,23 +48,24 @@ int OpenContext(URLContext* h, const char* filename, int flags) { } int ReadContext(URLContext* h, unsigned char* buf, int size) { - return read(GetHandle(h), buf, size); + return HANDLE_EINTR(read(GetHandle(h), buf, size)); } int WriteContext(URLContext* h, unsigned char* buf, int size) { - return write(GetHandle(h), buf, size); + return HANDLE_EINTR(write(GetHandle(h), buf, size)); } -offset_t SeekContext(URLContext* h, offset_t offset, int whence) { +int64 SeekContext(URLContext* h, int64 offset, int whence) { + COMPILE_ASSERT(sizeof(off_t) == 8, off_t_not_64_bit); #if defined(OS_WIN) - return lseek(GetHandle(h), static_cast<long>(offset), whence); + return _lseeki64(GetHandle(h), static_cast<__int64>(offset), whence); #else - return lseek(GetHandle(h), offset, whence); + return lseek(GetHandle(h), static_cast<off_t>(offset), whence); #endif } int CloseContext(URLContext* h) { - return close(GetHandle(h)); + return HANDLE_EINTR(close(GetHandle(h))); } } // namespace |