diff options
author | James Zern <jzern@google.com> | 2014-04-17 14:58:55 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2014-04-17 14:58:55 -0700 |
commit | 9b5997fa0a3ff41c0d2261e0cb5e12f4c26d11ab (patch) | |
tree | 3b686bde8524112fc8900dee5fef862530194725 | |
parent | 69009e738eed9853803be8b90a7a7f40434d5337 (diff) | |
parent | e3578af32c506b209c3ca460e999d6ce6249a551 (diff) | |
download | libvpx-9b5997fa0a3ff41c0d2261e0cb5e12f4c26d11ab.tar libvpx-9b5997fa0a3ff41c0d2261e0cb5e12f4c26d11ab.tar.gz libvpx-9b5997fa0a3ff41c0d2261e0cb5e12f4c26d11ab.tar.bz2 libvpx-9b5997fa0a3ff41c0d2261e0cb5e12f4c26d11ab.zip |
Merge "examples: remove off_t overrides"
-rw-r--r-- | tools_common.h | 10 | ||||
-rw-r--r-- | vpxenc.c | 14 |
2 files changed, 9 insertions, 15 deletions
diff --git a/tools_common.h b/tools_common.h index 549e895ec..21248827a 100644 --- a/tools_common.h +++ b/tools_common.h @@ -25,15 +25,10 @@ /* MSVS uses _f{seek,tell}i64. */ #define fseeko _fseeki64 #define ftello _ftelli64 -typedef long _off_t; // NOLINT - MSVS compatible type -typedef __int64 off_t; // fseeki64 compatible type -#define _OFF_T_DEFINED #elif defined(_WIN32) -/* MinGW defines off_t as long and uses f{seek,tell}o64/off64_t for large - * files. */ +/* MinGW uses f{seek,tell}o64 for large files. */ #define fseeko fseeko64 #define ftello ftello64 -#define off_t off64_t #endif /* _WIN32 */ #if CONFIG_OS_SUPPORT @@ -50,7 +45,6 @@ typedef __int64 off_t; // fseeki64 compatible type /* Use 32-bit file operations in WebM file format when building ARM * executables (.axf) with RVCT. */ #if !CONFIG_OS_SUPPORT -typedef long off_t; /* NOLINT */ #define fseeko fseek #define ftello ftell #endif /* CONFIG_OS_SUPPORT */ @@ -90,7 +84,7 @@ struct VpxRational { struct VpxInputContext { const char *filename; FILE *file; - off_t length; + int64_t length; struct FileTypeDetectionBuffer detect; enum VideoFileType file_type; uint32_t width; @@ -1281,7 +1281,7 @@ static void get_cx_data(struct stream_state *stream, *got_data = 0; while ((pkt = vpx_codec_get_cx_data(&stream->encoder, &iter))) { static size_t fsize = 0; - static off_t ivf_header_pos = 0; + static int64_t ivf_header_pos = 0; switch (pkt->kind) { case VPX_CODEC_CX_FRAME_PKT: @@ -1307,7 +1307,7 @@ static void get_cx_data(struct stream_state *stream, fsize += pkt->data.frame.sz; if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) { - off_t currpos = ftello(stream->file); + const int64_t currpos = ftello(stream->file); fseeko(stream->file, ivf_header_pos, SEEK_SET); ivf_write_frame_size(stream->file, fsize); fseeko(stream->file, currpos, SEEK_SET); @@ -1534,7 +1534,7 @@ int main(int argc, const char **argv_) { int frames_in = 0, seen_frames = 0; int64_t estimated_time_left = -1; int64_t average_rate = -1; - off_t lagged_count = 0; + int64_t lagged_count = 0; open_input_file(&input); @@ -1667,15 +1667,15 @@ int main(int argc, const char **argv_) { int64_t rate; if (global.limit) { - off_t frame_in_lagged = (seen_frames - lagged_count) * 1000; + const int64_t frame_in_lagged = (seen_frames - lagged_count) * 1000; rate = cx_time ? frame_in_lagged * (int64_t)1000000 / cx_time : 0; remaining = 1000 * (global.limit - global.skip_frames - seen_frames + lagged_count); } else { - off_t input_pos = ftello(input.file); - off_t input_pos_lagged = input_pos - lagged_count; - int64_t limit = input.length; + const int64_t input_pos = ftello(input.file); + const int64_t input_pos_lagged = input_pos - lagged_count; + const int64_t limit = input.length; rate = cx_time ? input_pos_lagged * (int64_t)1000000 / cx_time : 0; remaining = limit - input_pos + lagged_count; |