Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
9b5997fa
Commit
9b5997fa
authored
Apr 17, 2014
by
James Zern
Committed by
Gerrit Code Review
Apr 17, 2014
Browse files
Merge "examples: remove off_t overrides"
parents
69009e73
e3578af3
Changes
2
Hide whitespace changes
Inline
Side-by-side
tools_common.h
View file @
9b5997fa
...
...
@@ -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
;
...
...
vpxenc.c
View file @
9b5997fa
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment