From 1fea68e1505bc5a61f7e10422c0f39914ded64a2 Mon Sep 17 00:00:00 2001 From: Arun Kumar Dasari Date: Thu, 5 Nov 2015 15:56:09 +0530 Subject: [PATCH] Tinycompress : Update tinycompress with bug fixes/enhancement This change includes following changes, Fixed cplay bug. fread returns 1 since it is reading one block data so, in if condition read variable should be compared with 1. Added support to include sanitized kernel headers. In compress.c, added stdint.h header file to fix compilation errors seen with sanitized kernel headers. --- configure.ac | 6 ++++++ src/lib/compress.c | 1 + src/utils/cplay.c | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3b34dc6..c9251ea 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,12 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AM_PROG_CC_C_O + +AC_ARG_WITH(sanitized-headers, + AS_HELP_STRING([--with-sanitized-headers=DIR], + [Specify the location of the sanitized Linux headers]), + [CPPFLAGS="$CPPFLAGS -I$withval"]) + # Checks for libraries. # Checks for typedefs, structures, and compiler characteristics. diff --git a/src/lib/compress.c b/src/lib/compress.c index 84738d2..b6df7a3 100644 --- a/src/lib/compress.c +++ b/src/lib/compress.c @@ -54,6 +54,7 @@ #include #include +#include #include #include #include diff --git a/src/utils/cplay.c b/src/utils/cplay.c index 2d1a176..01a7097 100644 --- a/src/utils/cplay.c +++ b/src/utils/cplay.c @@ -218,7 +218,7 @@ void play_samples(char *name, unsigned int card, unsigned int device, } read = fread(&header, sizeof(header), 1, file); - if (read != sizeof(header)) { + if (read != 1) { fprintf(stderr, "Unable to read header \n"); fclose(file); exit(EXIT_FAILURE); @@ -233,6 +233,7 @@ void play_samples(char *name, unsigned int card, unsigned int device, codec.ch_in = channels; codec.ch_out = channels; codec.sample_rate = rate; + codec.compr_passthr = 0; if (!codec.sample_rate) { fprintf(stderr, "invalid sample rate %d\n", rate); fclose(file); -- 1.9.1