Change dx_time data type in vpxdec.c
Change dx_time data type to int64_t to prevent test time overflow when decoding long video. Change-Id: I3dd5e324a246843e07e635fd25c50e71e385ed70 Signed-off-by: James Yu <james.yu@linaro.org>
This commit is contained in:
parent
c30cc9f2e4
commit
6d15132742
11
vpxdec.c
11
vpxdec.c
@ -298,10 +298,11 @@ int file_is_raw(struct VpxInputContext *input) {
|
|||||||
return is_raw;
|
return is_raw;
|
||||||
}
|
}
|
||||||
|
|
||||||
void show_progress(int frame_in, int frame_out, unsigned long dx_time) {
|
void show_progress(int frame_in, int frame_out, uint64_t dx_time) {
|
||||||
fprintf(stderr, "%d decoded frames/%d showed frames in %lu us (%.2f fps)\r",
|
fprintf(stderr,
|
||||||
|
"%d decoded frames/%d showed frames in %"PRId64" us (%.2f fps)\r",
|
||||||
frame_in, frame_out, dx_time,
|
frame_in, frame_out, dx_time,
|
||||||
(float)frame_out * 1000000.0 / (float)dx_time);
|
(double)frame_out * 1000000.0 / (double)dx_time);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct ExternalFrameBuffer {
|
struct ExternalFrameBuffer {
|
||||||
@ -493,7 +494,7 @@ int main_loop(int argc, const char **argv_) {
|
|||||||
int ec_enabled = 0;
|
int ec_enabled = 0;
|
||||||
const VpxInterface *interface = NULL;
|
const VpxInterface *interface = NULL;
|
||||||
const VpxInterface *fourcc_interface = NULL;
|
const VpxInterface *fourcc_interface = NULL;
|
||||||
unsigned long dx_time = 0;
|
uint64_t dx_time = 0;
|
||||||
struct arg arg;
|
struct arg arg;
|
||||||
char **argv, **argi, **argj;
|
char **argv, **argi, **argj;
|
||||||
|
|
||||||
@ -803,7 +804,7 @@ int main_loop(int argc, const char **argv_) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
vpx_usec_timer_mark(&timer);
|
vpx_usec_timer_mark(&timer);
|
||||||
dx_time += (unsigned int)vpx_usec_timer_elapsed(&timer);
|
dx_time += vpx_usec_timer_elapsed(&timer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user