From 44c55e44e80349f3023df2f1f98e65fc4f808c4a Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Mon, 6 Oct 2014 18:49:06 +0200 Subject: [PATCH] fix multiple compilation errors --- coreapi/linphonecore.c | 41 +++++++++++++++++++++-------------------- mediastreamer2 | 2 +- tester/player_tester.c | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index cac4a34b1..e477d9a44 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -399,28 +399,28 @@ static int compress_file(FILE *input_file, FILE *output_file, z_stream *strm) { int flush; int ret; size_t output_file_size = 0; - + do { strm->avail_in = fread(in, 1, sizeof(in), input_file); - if (ferror(input_file)) { - deflateEnd(strm); - return Z_ERRNO; - } - flush = feof(input_file) ? Z_FINISH : Z_NO_FLUSH; - strm->next_in = in; + if (ferror(input_file)) { + deflateEnd(strm); + return Z_ERRNO; + } + flush = feof(input_file) ? Z_FINISH : Z_NO_FLUSH; + strm->next_in = in; do { strm->avail_out = sizeof(out); - strm->next_out = out; + strm->next_out = out; ret = deflate(strm, flush); have = sizeof(out) - strm->avail_out; - if (fwrite(out, 1, have, output_file) != have || ferror(output_file)) { - deflateEnd(strm); - return Z_ERRNO; - } - output_file_size += have; + if (fwrite(out, 1, have, output_file) != have || ferror(output_file)) { + deflateEnd(strm); + return Z_ERRNO; + } + output_file_size += have; } while (strm->avail_out == 0); } while (flush != Z_FINISH); - + return output_file_size; } @@ -432,9 +432,10 @@ static int compress_file(FILE *input_file, FILE *output_file, z_stream *strm) { static int compress_file(FILE *input_file, FILE *output_file) { char buffer[131072]; /* 128kB */ size_t output_file_size = 0; + size_t bytes; - while ((bytes = fread(buffer, 1, sizeof(buffer), input_file) > 0) { - if (bytes < 0) return bytes; + while ((bytes = fread(buffer, 1, sizeof(buffer), input_file)) > 0) { + if (bytes == 0) return bytes; fwrite(buffer, 1, bytes, output_file); output_file_size += bytes; } @@ -454,10 +455,10 @@ static size_t prepare_log_collection_file_to_upload(const char *filename) { #ifdef HAVE_ZLIB z_stream strm; strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - ret = deflateInit(&strm, Z_DEFAULT_COMPRESSION); - if (ret != Z_OK) return ret; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + ret = deflateInit(&strm, Z_DEFAULT_COMPRESSION); + if (ret != Z_OK) return ret; #endif output_filename = ortp_strdup_printf("%s/%s", liblinphone_log_collection_path, filename); diff --git a/mediastreamer2 b/mediastreamer2 index 91f278207..548ccf41f 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 91f2782073c776b2d5ce3ab0a12561aea7610068 +Subproject commit 548ccf41fa0d3cd3ab48d0eff44d3bed45083312 diff --git a/tester/player_tester.c b/tester/player_tester.c index 57a57da60..a9b82b07a 100644 --- a/tester/player_tester.c +++ b/tester/player_tester.c @@ -20,7 +20,7 @@ static const char *_get_default_video_renderer(void){ static bool_t wait_for_eof(bool_t *eof, int *time,int time_refresh, int timeout) { while(*time < timeout && !*eof) { - usleep(time_refresh * 1000U); + ms_usleep(time_refresh * 1000U); *time += time_refresh; } return *time < timeout;