Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: media/ffmpeg/file_protocol.cc

Issue 2136017: Handle EINTR and remove offset_t in ffmpeg code. (Closed)
Patch Set: Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/ffmpeg/ffmpeg_common.h ('k') | media/filters/ffmpeg_glue.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/ffmpeg/file_protocol.cc
diff --git a/media/ffmpeg/file_protocol.cc b/media/ffmpeg/file_protocol.cc
index 2d1bd1d9427b98b702027eea123a97d0e09f8d11..07a6697c4e4b9d60d84211bcd4292892ec6d2cf2 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,19 @@ 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) {
-#if defined(OS_WIN)
- return lseek(GetHandle(h), static_cast<long>(offset), whence);
-#else
- return lseek(GetHandle(h), offset, whence);
-#endif
+int64 SeekContext(URLContext* h, int64 offset, int whence) {
+ return lseek(GetHandle(h), static_cast<off_t>(offset), whence);
wtc 2010/05/19 17:20:42 MSVC has _lseeki64, which takes a 64-bit offset ar
agl 2010/05/19 18:07:32 I figured that off_t would be 64-bit on Windows, b
awong 2010/05/19 18:12:56 Doesn't off_t change on glibc depending on the var
wtc 2010/05/19 18:44:55 We can add a static assertion to assert that sizeo
}
int CloseContext(URLContext* h) {
- return close(GetHandle(h));
+ return HANDLE_EINTR(close(GetHandle(h)));
}
} // namespace
« no previous file with comments | « media/ffmpeg/ffmpeg_common.h ('k') | media/filters/ffmpeg_glue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698