summaryrefslogtreecommitdiff
path: root/tests/api
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-11 20:24:53 -0300
committerJames Almer <jamrial@gmail.com>2017-03-12 14:29:10 -0300
commit88deeb3eba00271e9fb82177860c743fc564e8c0 (patch)
treee21b83f3d1a32e6513d586729c616ec91026ebb5 /tests/api
parente73325b971b37dd4741c49541c74cde0739dab8c (diff)
downloadffmpeg-88deeb3eba00271e9fb82177860c743fc564e8c0.tar.gz
tests/api-seek: make the crc array uint32_t
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'tests/api')
-rw-r--r--tests/api/api-seek-test.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/api/api-seek-test.c b/tests/api/api-seek-test.c
index cc3287b28f..6ef3b91933 100644
--- a/tests/api/api-seek-test.c
+++ b/tests/api/api-seek-test.c
@@ -30,17 +30,17 @@
#include "libavutil/imgutils.h"
int64_t *pts_array;
-int64_t *crc_array;
+uint32_t *crc_array;
int size_of_array;
int number_of_elements;
-static int add_crc_to_array(int64_t crc, int64_t pts)
+static int add_crc_to_array(uint32_t crc, int64_t pts)
{
if (size_of_array <= number_of_elements) {
if (size_of_array == 0)
size_of_array = 10;
size_of_array *= 2;
- crc_array = av_realloc(crc_array, size_of_array * sizeof(int64_t));
+ crc_array = av_realloc(crc_array, size_of_array * sizeof(uint32_t));
pts_array = av_realloc(pts_array, size_of_array * sizeof(int64_t));
if ((crc_array == NULL) || (pts_array == NULL)) {
av_log(NULL, AV_LOG_ERROR, "Can't allocate array to store crcs\n");
@@ -53,13 +53,13 @@ static int add_crc_to_array(int64_t crc, int64_t pts)
return 0;
}
-static int compare_crc_in_array(int64_t crc, int64_t pts)
+static int compare_crc_in_array(uint32_t crc, int64_t pts)
{
int i;
for (i = 0; i < number_of_elements; i++) {
if (pts_array[i] == pts) {
if (crc_array[i] == crc) {
- printf("Comparing 0x%08lx %"PRId64" %d is OK\n", crc, pts, i);
+ printf("Comparing 0x%08"PRIx32" %"PRId64" %d is OK\n", crc, pts, i);
return 0;
}
else {
@@ -81,7 +81,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream,
int end_of_stream = 0;
int byte_buffer_size;
uint8_t *byte_buffer;
- int64_t crc;
+ uint32_t crc;
AVPacket pkt;
byte_buffer_size = av_image_get_buffer_size(ctx->pix_fmt, ctx->width, ctx->height, 16);
@@ -132,7 +132,7 @@ static int compute_crc_of_packets(AVFormatContext *fmt_ctx, int video_stream,
if ((!no_seeking) && (fr->pts > ts_end))
break;
crc = av_adler32_update(0, (const uint8_t*)byte_buffer, number_of_written_bytes);
- printf("%10"PRId64", 0x%08lx\n", fr->pts, crc);
+ printf("%10"PRId64", 0x%08"PRIx32"\n", fr->pts, crc);
if (no_seeking) {
if (add_crc_to_array(crc, fr->pts) < 0)
return -1;
@@ -185,7 +185,8 @@ static int seek_test(const char *input_filename, const char *start, const char *
size_of_array = 0;
number_of_elements = 0;
- crc_array = pts_array = NULL;
+ crc_array = NULL;
+ pts_array = NULL;
result = avformat_open_input(&fmt_ctx, input_filename, NULL, NULL);
if (result < 0) {