mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 15:02:43 +02:00
small fix
Origin commit data
------------------
Branch: master
Commit: aa006562ae
Author: BPanther <bpanther_ts@hotmail.com>
Date: 2024-03-24 (Sun, 24 Mar 2024)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -87,7 +87,7 @@ static bool IsRegular(const char *pPath)
|
||||
{
|
||||
struct stat st = {0};
|
||||
|
||||
if (0 == lstat(pPath, &st) && S_ISREG(st.st_mode))
|
||||
if (lstat(pPath, &st) == 0 && S_ISREG(st.st_mode))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ static void RemoveAllRegularFiles(const char *mainDir, const char *filePattern)
|
||||
return;
|
||||
|
||||
DIR *dirp = opendir(mainDir);
|
||||
if (0 == dirp)
|
||||
if (dirp == 0)
|
||||
return;
|
||||
|
||||
struct dirent *pDir = 0;
|
||||
@@ -111,7 +111,7 @@ static void RemoveAllRegularFiles(const char *mainDir, const char *filePattern)
|
||||
while (1)
|
||||
{
|
||||
pDir = readdir(dirp);
|
||||
if (0 == pDir)
|
||||
if (pDir == 0)
|
||||
break;
|
||||
|
||||
if (pDir->d_type != DT_REG && pDir->d_type != DT_UNKNOWN)
|
||||
@@ -121,7 +121,7 @@ static void RemoveAllRegularFiles(const char *mainDir, const char *filePattern)
|
||||
if (pDir->d_type == DT_UNKNOWN && !IsRegular(fullpath))
|
||||
continue;
|
||||
|
||||
if (0 == fnmatch(filePattern, pDir->d_name, 0))
|
||||
if (fnmatch(filePattern, pDir->d_name, 0) == 0)
|
||||
remove(fullpath);
|
||||
}
|
||||
}
|
||||
@@ -295,7 +295,7 @@ static int32_t Write(WriterSubCallData_t *subPacket)
|
||||
g_sys->p_swctx = sws_getCachedContext(g_sys->p_swctx, rec->w, rec->h, AV_PIX_FMT_PAL8, desc_tab[j].w, desc_tab[j].h, AV_PIX_FMT_RGBA, SWS_BICUBIC, NULL, NULL, NULL); // SWS_FAST_BILINEAR
|
||||
sws_scale(g_sys->p_swctx, (const uint8_t *const *)rec->data, rec->linesize, 0, rec->h, data, linesize);
|
||||
|
||||
if (0 == PNGPlugin_saveRGBAImage(filepath, &(data[0][0]), desc_tab[j].w, desc_tab[j].h))
|
||||
if (PNGPlugin_saveRGBAImage(filepath, &(data[0][0]), desc_tab[j].w, desc_tab[j].h) == 0)
|
||||
{
|
||||
j += 1;
|
||||
}
|
||||
|
@@ -151,7 +151,7 @@ static void LinuxDvbBuffThread(Context_t *context)
|
||||
|
||||
PlaybackDieNowRegisterCallback(WriteWakeUp);
|
||||
|
||||
while (0 == PlaybackDieNow(0))
|
||||
while (PlaybackDieNow(0) == 0)
|
||||
{
|
||||
pthread_mutex_lock(&bufferingMtx);
|
||||
g_bDuringWrite = false;
|
||||
@@ -451,7 +451,7 @@ ssize_t BufferingWriteV(int fd, const struct iovec *iov, int ic)
|
||||
}
|
||||
|
||||
pthread_mutex_lock(&bufferingMtx);
|
||||
while (0 == PlaybackDieNow(0))
|
||||
while (PlaybackDieNow(0) == 0)
|
||||
{
|
||||
if (bufferingDataSize + chunkSize >= maxBufferingDataSize)
|
||||
{
|
||||
|
@@ -154,7 +154,7 @@ static int _writeData(WriterAVCallData_t *call, int type)
|
||||
}
|
||||
|
||||
/* simple validation */
|
||||
if (0 == type) // check ADTS header
|
||||
if (type == 0) // check ADTS header
|
||||
{
|
||||
if (0xFF != call->data[0] || 0xF0 != (0xF0 & call->data[1]))
|
||||
{
|
||||
@@ -163,7 +163,7 @@ static int _writeData(WriterAVCallData_t *call, int type)
|
||||
}
|
||||
|
||||
// STB can handle only AAC LC profile
|
||||
if (0 == (call->data[2] & 0xC0))
|
||||
if ((call->data[2] & 0xC0) == 0)
|
||||
{
|
||||
// change profile AAC Main -> AAC LC (Low Complexity)
|
||||
aac_printf(1, "change profile AAC Main -> AAC LC (Low Complexity) in the ADTS header");
|
||||
@@ -204,7 +204,7 @@ static int writeDataADTS(WriterAVCallData_t *call)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((call->private_data && 0 == strncmp("ADTS", (const char *)call->private_data, call->private_size)) ||
|
||||
if ((call->private_data && strncmp("ADTS", (const char *)call->private_data, call->private_size) == 0) ||
|
||||
HasADTSHeader(call->data, call->len))
|
||||
{
|
||||
//printf("%hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx\n", call->data[0], call->data[1], call->data[2], call->data[3], call->data[4], call->data[5], call->data[6], call->data[7]);
|
||||
@@ -269,7 +269,7 @@ static int writeDataLATM(WriterAVCallData_t *call)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (call->private_data && 0 == strncmp("LATM", (const char *)call->private_data, call->private_size))
|
||||
if (call->private_data && strncmp("LATM", (const char *)call->private_data, call->private_size) == 0)
|
||||
{
|
||||
return _writeData(call, 1);
|
||||
}
|
||||
|
@@ -334,7 +334,7 @@ static int writeData(WriterAVCallData_t *call)
|
||||
}
|
||||
|
||||
/* AnnexA */
|
||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
||||
if (!avc3 && ((1 < call->private_size && call->private_data[0] == 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)))))
|
||||
{
|
||||
|
@@ -111,7 +111,7 @@ ssize_t WriteWithRetry(Context_t *context, int pipefd, int fd, void *pDVBMtx __a
|
||||
int retval = -1;
|
||||
int maxFd = pipefd > fd ? pipefd : fd;
|
||||
struct timeval tv;
|
||||
while (size > 0 && 0 == PlaybackDieNow(0) && !context->playback->isSeeking)
|
||||
while (size > 0 && PlaybackDieNow(0) == 0 && !context->playback->isSeeking)
|
||||
{
|
||||
FD_ZERO(&rfds);
|
||||
FD_ZERO(&wfds);
|
||||
@@ -194,7 +194,7 @@ ssize_t write_with_retry(int fd, const void *buf, int size)
|
||||
{
|
||||
ssize_t ret;
|
||||
int retval = 0;
|
||||
while (size > 0 && 0 == PlaybackDieNow(0))
|
||||
while (size > 0 && PlaybackDieNow(0) == 0)
|
||||
{
|
||||
ret = write(fd, buf, size);
|
||||
if (ret < 0)
|
||||
|
@@ -153,7 +153,7 @@ static int _writeData(void *_call, int type)
|
||||
}
|
||||
|
||||
/* simple validation */
|
||||
if (0 == type) // check ADTS header
|
||||
if (type == 0) // check ADTS header
|
||||
{
|
||||
if (0xFF != call->data[0] || 0xF0 != (0xF0 & call->data[1]))
|
||||
{
|
||||
@@ -162,7 +162,7 @@ static int _writeData(void *_call, int type)
|
||||
}
|
||||
|
||||
// STB can handle only AAC LC profile
|
||||
if (0 == (call->data[2] & 0xC0))
|
||||
if ((call->data[2] & 0xC0) == 0)
|
||||
{
|
||||
// change profile AAC Main -> AAC LC (Low Complexity)
|
||||
aac_printf(1, "change profile AAC Main -> AAC LC (Low Complexity) in the ADTS header");
|
||||
@@ -217,7 +217,7 @@ static int writeDataADTS(void *_call)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((call->private_data && 0 == strncmp("ADTS", call->private_data, call->private_size)) ||
|
||||
if ((call->private_data && strncmp("ADTS", call->private_data, call->private_size) == 0) ||
|
||||
HasADTSHeader(call->data, call->len))
|
||||
{
|
||||
return _writeData(_call, 0);
|
||||
@@ -281,7 +281,7 @@ static int writeDataLATM(void *_call)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (call->private_data && 0 == strncmp("LATM", call->private_data, call->private_size))
|
||||
if (call->private_data && strncmp("LATM", call->private_data, call->private_size) == 0)
|
||||
{
|
||||
return _writeData(_call, 1);
|
||||
}
|
||||
|
@@ -236,7 +236,7 @@ static int32_t writeData(void *_call)
|
||||
}
|
||||
|
||||
/* AnnexA */
|
||||
if (!avc3 && ((1 < call->private_size && 0 == call->private_data[0]) ||
|
||||
if (!avc3 && ((1 < call->private_size && call->private_data[0] == 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))))
|
||||
{
|
||||
|
@@ -105,7 +105,7 @@ ssize_t WriteWithRetry(Context_t *context, int pipefd, int fd, void *pDVBMtx, co
|
||||
int retval = -1;
|
||||
struct timeval tv;
|
||||
|
||||
while (size > 0 && 0 == PlaybackDieNow(0) && !context->playback->isSeeking)
|
||||
while (size > 0 && PlaybackDieNow(0) == 0 && !context->playback->isSeeking)
|
||||
{
|
||||
if (context->playback->isPaused)
|
||||
{
|
||||
|
Reference in New Issue
Block a user