- fix-compiler-warnings

This commit is contained in:
max_10
2019-02-03 00:36:28 +01:00
committed by Thilo Graf
parent 32bc62a65b
commit cb7c9874e8
6 changed files with 14 additions and 24 deletions

View File

@@ -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

View File

@@ -283,6 +283,7 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne
{
*NalLength = 0;
}
return ret;
}

View File

@@ -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");

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;