libeplayer3-arm: reduce compiler warnings

This commit is contained in:
max_10
2018-02-08 20:42:15 +01:00
committed by Thilo Graf
parent 0bd3f48ff2
commit e5d24ce4ed
22 changed files with 105 additions and 87 deletions

View File

@@ -182,7 +182,7 @@ static int _writeData(void *_call, int type)
else // check LOAS header
{
if (!(call->len > 2 && call->data[0] == 0x56 && (call->data[1] >> 4) == 0xe &&
(AV_RB16(call->data + 1) & 0x1FFF) + 3 == call->len))
((uint32_t)(AV_RB16(call->data + 1) & 0x1FFF) + 3) == call->len))
{
aac_err("parsing Data with wrong latm header. ignoring...\n");
return 0;
@@ -218,7 +218,7 @@ static int writeDataADTS(void *_call)
aac_err("file pointer < 0. ignoring ...\n");
return 0;
}
if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) ||
if ((call->private_data && 0 == strncmp("ADTS", (const char *)call->private_data, call->private_size)) ||
HasADTSHeader(call->data, call->len))
{
return _writeData(_call, 0);
@@ -272,7 +272,7 @@ static int writeDataLATM(void *_call)
aac_err("parsing NULL Data. ignoring...\n");
return 0;
}
if (call->private_data && 0 == strncmp("LATM", call->private_data, call->private_size))
if (call->private_data && 0 == strncmp("LATM", (const char *)call->private_data, call->private_size))
{
return _writeData(_call, 1);
}

View File

@@ -117,7 +117,7 @@ static int writeData(void *_call)
{
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
unsigned char PesHeader[PES_MAX_HEADER_SIZE + 4];
unsigned char Version = 5;
// unsigned char Version = 5;
// unsigned int FakeStartCode = (Version << 8) | PES_VERSION_FAKE_START_CODE;
divx_printf(10, "\n");
if (call == NULL)

View File

@@ -195,12 +195,14 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne
if (cd_len > 7 && data[0] == 1)
{
unsigned short len = (data[6] << 8) | data[7];
if (cd_len >= (len + 8))
if (cd_len >= (uint32_t)(len + 8))
{
unsigned int i = 0;
uint8_t profile_num[] = { 66, 77, 88, 100 };
uint8_t profile_cmp[2] = { 0x67, 0x00 };
const char *profile_str[] = { "baseline", "main", "extended", "high" };
/* avoid compiler warning */
if (*profile_str) {}
memcpy(tmp, Head, sizeof(Head));
tmp_len += 4;
memcpy(tmp + tmp_len, data + 8, len);
@@ -289,7 +291,7 @@ static int writeData(void *_call)
unsigned long long int VideoPts;
unsigned int TimeDelta;
unsigned int TimeScale;
int len = 0;
unsigned int len = 0;
int ic = 0;
struct iovec iov[IOVEC_SIZE];
h264_printf(20, "\n");
@@ -300,6 +302,9 @@ static int writeData(void *_call)
}
TimeDelta = call->FrameRate;
TimeScale = call->FrameScale;
/* avoid compiler warnings */
if (TimeDelta) {}
if (TimeScale) {}
VideoPts = call->Pts;
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
if ((call->data == NULL) || (call->len <= 0))
@@ -314,8 +319,8 @@ static int writeData(void *_call)
}
/* AnnexA */
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
(call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff))))
((call->len > 3) && ((call->data[0] == 0x00 && call->data[1] == 0x00 && call->data[2] == 0x00 && call->data[3] == 0x01) ||
(call->data[0] == 0xff && call->data[1] == 0xff && call->data[2] == 0xff && call->data[3] == 0xff)))))
{
uint32_t PacketLength = 0;
uint32_t FakeStartCode = (call->Version << 8) | PES_VERSION_FAKE_START_CODE;

View File

@@ -116,7 +116,7 @@ static int32_t PreparCodecData(unsigned char *data, unsigned int cd_len, unsigne
}
*NalLength = (data[21] & 3) + 1;
int num_param_sets = data[22];
int pos = 23;
uint32_t pos = 23;
for (i = 0; i < num_param_sets; i++)
{
int j;
@@ -175,7 +175,7 @@ static int writeData(void *_call)
unsigned long long int VideoPts;
unsigned int TimeDelta;
unsigned int TimeScale;
int len = 0;
unsigned int len = 0;
int ic = 0;
struct iovec iov[IOVEC_SIZE];
h264_printf(20, "\n");
@@ -186,6 +186,9 @@ static int writeData(void *_call)
}
TimeDelta = call->FrameRate;
TimeScale = call->FrameScale;
/* avoid compiler warnings */
if (TimeDelta) {}
if (TimeScale) {}
VideoPts = call->Pts;
h264_printf(20, "VideoPts %lld - %d %d\n", call->Pts, TimeDelta, TimeScale);
if ((call->data == NULL) || (call->len <= 0))

View File

@@ -152,7 +152,7 @@ static int32_t writeData(void *_call)
int32_t block_align = 0;
int32_t byterate = 0;
uint32_t codecID = (uint32_t)pcmPrivateData->ffmpeg_codec_id;
uint8_t dataPrecision = 0;
//uint8_t dataPrecision = 0;
uint8_t LE = 0;
switch (codecID)
{
@@ -224,6 +224,8 @@ static int32_t writeData(void *_call)
fixed_buffer = malloc(fixed_buffersize);
}
fixed_bufferfilled = 0;
/* avoid compiler warning */
if (LE) {}
//printf("PCM fixed_buffersize [%u] [%s]\n", fixed_buffersize, LE ? "LE":"BE");
}
while (size > 0)

View File

@@ -110,7 +110,7 @@ static int reset()
static int writeData(void *_call)
{
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
int len = 0;
//int len = 0;
vc1_printf(10, "\n");
if (call == NULL)
{

View File

@@ -106,7 +106,7 @@ static int reset()
static int writeData(void *_call)
{
WriterAVCallData_t *call = (WriterAVCallData_t *) _call;
int len = 0;
//int len = 0;
wma_printf(10, "\n");
if (call == NULL)
{

View File

@@ -145,7 +145,7 @@ ssize_t write_with_retry(int fd, const void *buf, size_t size)
ssize_t writev_with_retry(int fd, const struct iovec *iov, size_t ic)
{
ssize_t len = 0;
int i = 0;
uint32_t i = 0;
for (i = 0; i < ic; ++i)
{
write_with_retry(fd, iov[i].iov_base, iov[i].iov_len);