From d78d9d38fd292496fb6112d84e8c5acb28732c9f Mon Sep 17 00:00:00 2001 From: max_10 Date: Sun, 3 Feb 2019 00:36:28 +0100 Subject: [PATCH] fix-compiler-warnings Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/20dda4128bd4d4e9e75228f91892392d80bbaba4 Author: max_10 Date: 2019-02-03 (Sun, 03 Feb 2019) Origin message was: ------------------ - fix-compiler-warnings ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3-arm/output/writer/common/misc.c | 4 ++-- libeplayer3-arm/output/writer/mipsel/h264.c | 1 + libeplayer3-arm/output/writer/mipsel/mjpeg.c | 11 ++--------- libeplayer3-arm/output/writer/mipsel/mpeg2.c | 10 +++------- libeplayer3-arm/output/writer/mipsel/vp.c | 10 +++++----- libeplayer3-arm/output/writer/mipsel/writer.c | 2 +- 6 files changed, 14 insertions(+), 24 deletions(-) diff --git a/libeplayer3-arm/output/writer/common/misc.c b/libeplayer3-arm/output/writer/common/misc.c index dce61a5..bb4d42a 100644 --- a/libeplayer3-arm/output/writer/common/misc.c +++ b/libeplayer3-arm/output/writer/common/misc.c @@ -132,12 +132,12 @@ stb_type_t GetSTBType() static stb_type_t type = STB_UNKNOWN; if (type == STB_UNKNOWN) { - struct stat buffer; +// struct stat buffer; if (access("/proc/stb/tpm/0/serial", F_OK) != -1) { type = STB_DREAMBOX; } - else if (access("/proc/stb/info/vumodel", F_OK) != -1 && \ + else if (access("/proc/stb/info/vumodel", F_OK) != -1 && access("/proc/stb/info/boxtype", F_OK) == -1) { // some STB like Octagon SF4008 has also /proc/stb/info/vumodel diff --git a/libeplayer3-arm/output/writer/mipsel/h264.c b/libeplayer3-arm/output/writer/mipsel/h264.c index 905832c..1b01c5c 100644 --- a/libeplayer3-arm/output/writer/mipsel/h264.c +++ b/libeplayer3-arm/output/writer/mipsel/h264.c @@ -283,6 +283,7 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne { *NalLength = 0; } + return ret; } diff --git a/libeplayer3-arm/output/writer/mipsel/mjpeg.c b/libeplayer3-arm/output/writer/mipsel/mjpeg.c index 2fc0bab..2ee6aa0 100755 --- a/libeplayer3-arm/output/writer/mipsel/mjpeg.c +++ b/libeplayer3-arm/output/writer/mipsel/mjpeg.c @@ -58,13 +58,10 @@ /* ***************************** */ /* ***************************** */ -/* Varaibles */ +/* Variables */ /* ***************************** */ static bool must_send_header = true; -static uint8_t *private_data = NULL; -static uint32_t private_size = 0; - /* ***************************** */ /* Prototypes */ @@ -80,13 +77,9 @@ static int reset() return 0; } -static int writeData(void *_call) +static int writeData(WriterAVCallData_t *call) { - WriterAVCallData_t *call = (WriterAVCallData_t *) _call; - static uint8_t PesHeader[PES_MAX_HEADER_SIZE]; - int32_t len = 0; - uint32_t Position = 0; mjpeg_printf(10, "\n"); diff --git a/libeplayer3-arm/output/writer/mipsel/mpeg2.c b/libeplayer3-arm/output/writer/mipsel/mpeg2.c index 414a1c5..26746f3 100644 --- a/libeplayer3-arm/output/writer/mipsel/mpeg2.c +++ b/libeplayer3-arm/output/writer/mipsel/mpeg2.c @@ -82,11 +82,7 @@ static int reset() static int writeData(WriterAVCallData_t *call) { - unsigned char PesHeader[PES_MAX_HEADER_SIZE]; - static uint8_t PesHeader[PES_MAX_HEADER_SIZE]; - int32_t len = 0; - uint32_t Position = 0; mpeg2_printf(10, "\n"); @@ -206,7 +202,7 @@ static int writeData(WriterAVCallData_t *call) codec_data_size = call->private_size; } - while (pos <= data_len - 4) + while ((unsigned)pos <= data_len - 4) { if (memcmp(&data[pos], "\x00\x00\x01\xb8", 4)) /* find group start code */ { @@ -243,8 +239,8 @@ static int writeData(WriterAVCallData_t *call) PesHeader[6] = 0x81; UpdatePesHeaderPayloadSize(PesHeader, data_len + iov[0].iov_len - 6); - if (iov[0].iov_len != WriteExt(call->WriteV, call->fd, iov[0].iov_base, iov[0].iov_len)) return -1; - if (iov[1].iov_len != WriteExt(call->WriteV, call->fd, iov[1].iov_base, iov[1].iov_len)) return -1; + if (iov[0].iov_len != (unsigned)WriteExt(call->WriteV, call->fd, iov[0].iov_base, iov[0].iov_len)) return -1; + if (iov[1].iov_len != (unsigned)WriteExt(call->WriteV, call->fd, iov[1].iov_base, iov[1].iov_len)) return -1; return 1; } diff --git a/libeplayer3-arm/output/writer/mipsel/vp.c b/libeplayer3-arm/output/writer/mipsel/vp.c index 3bfc97e..4922287 100644 --- a/libeplayer3-arm/output/writer/mipsel/vp.c +++ b/libeplayer3-arm/output/writer/mipsel/vp.c @@ -136,7 +136,7 @@ static int writeData(WriterAVCallData_t *call, bool is_vp6, bool is_vp9) UpdatePesHeaderPayloadSize(PesHeader, payload_len); // it looks like for VUPLUS drivers PES header must be written separately int ret = call->WriteV(call->fd, iov, 1); - if (iov[0].iov_len != ret) + if (iov[0].iov_len != (unsigned)ret) return ret; ret = call->WriteV(call->fd, iov + 1, 1); return iov[0].iov_len + ret; @@ -150,12 +150,12 @@ static int writeData(WriterAVCallData_t *call, bool is_vp6, bool is_vp9) int bytes = payload_len - 10 - 8; UpdatePesHeaderPayloadSize(PesHeader, payload_len); // pes header - if (pes_header_len != WriteExt(call->WriteV, call->fd, PesHeader, pes_header_len)) return -1; + if (pes_header_len != (unsigned)WriteExt(call->WriteV, call->fd, PesHeader, pes_header_len)) return -1; if (bytes != WriteExt(call->WriteV, call->fd, call->data, bytes)) return -1; offs += bytes; - while (bytes < call->len) + while ((unsigned)bytes < call->len) { int left = call->len - bytes; int wr = 0x8000; @@ -177,7 +177,7 @@ static int writeData(WriterAVCallData_t *call, bool is_vp6, bool is_vp9) UpdatePesHeaderPayloadSize(PesHeader, wr + 3); - if (pes_header_len != WriteExt(call->WriteV, call->fd, PesHeader, pes_header_len)) return -1; + if (pes_header_len != (unsigned)WriteExt(call->WriteV, call->fd, PesHeader, pes_header_len)) return -1; if (wr != WriteExt(call->WriteV, call->fd, call->data + offs, wr)) return -1; bytes += wr; @@ -209,7 +209,7 @@ static int writeData(WriterAVCallData_t *call, bool is_vp6, bool is_vp9) PesHeader[29] = 0xFF; PesHeader[33] = 0x85; - if (pes_header_len != WriteExt(call->WriteV, call->fd, PesHeader, 184)) return -1; + if (pes_header_len != (unsigned)WriteExt(call->WriteV, call->fd, PesHeader, 184)) return -1; return 1; } diff --git a/libeplayer3-arm/output/writer/mipsel/writer.c b/libeplayer3-arm/output/writer/mipsel/writer.c index 36d7eb7..bd6d484 100644 --- a/libeplayer3-arm/output/writer/mipsel/writer.c +++ b/libeplayer3-arm/output/writer/mipsel/writer.c @@ -97,7 +97,7 @@ static Writer_t *AvailableWriter[] = /* Functions */ /* ***************************** */ -ssize_t WriteWithRetry(Context_t *context, int pipefd, int fd, void *pDVBMtx, const void *buf, int size) +ssize_t WriteWithRetry(Context_t *context, int pipefd, int fd, void *pDVBMtx __attribute__((unused)), const void *buf, int size) { fd_set rfds; fd_set wfds;