mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
addition to "small fix"
Origin commit data
------------------
Branch: master
Commit: 0737aa3ba6
Author: vanhofen <vanhofen@gmx.de>
Date: 2024-03-25 (Mon, 25 Mar 2024)
Origin message was:
------------------
- addition to "small fix"
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -573,7 +573,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
|
||||
{
|
||||
int _pid;
|
||||
char _lang[strlen(TrackList[i])];
|
||||
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang))
|
||||
if (sscanf(TrackList[i], "%d %s\n", &_pid, _lang) == 2)
|
||||
{
|
||||
apids[j] = _pid;
|
||||
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC
|
||||
@@ -639,7 +639,7 @@ void cPlayback::FindAllSubtitlePids(int *pids, unsigned int *numpids, std::strin
|
||||
{
|
||||
int _pid;
|
||||
char _lang[strlen(TrackList[i])];
|
||||
if (2 == sscanf(TrackList[i], "%d %s\n", &_pid, _lang))
|
||||
if (sscanf(TrackList[i], "%d %s\n", &_pid, _lang) == 2)
|
||||
{
|
||||
pids[j] = _pid;
|
||||
language[j] = std::string(_lang);
|
||||
|
@@ -1393,7 +1393,7 @@ static void FFMPEGThread(Context_t *context)
|
||||
do_seek_target_bytes = 1;
|
||||
bEndProcess = 0;
|
||||
}
|
||||
else if (1 == context->playback->isLoopMode)
|
||||
else if (context->playback->isLoopMode == 1)
|
||||
{
|
||||
int64_t tmpLength = 0;
|
||||
if (container_ffmpeg_get_length(context, &tmpLength) == 0 && tmpLength > 0 && get_play_pts() > 0)
|
||||
@@ -1676,11 +1676,11 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, uin
|
||||
rtmpProtoImplType = RTMP_NATIVE;
|
||||
}
|
||||
|
||||
if (1 == rtmp_proto_impl)
|
||||
if (rtmp_proto_impl == 1)
|
||||
{
|
||||
rtmpProtoImplType = RTMP_NATIVE;
|
||||
}
|
||||
else if (2 == rtmp_proto_impl)
|
||||
else if (rtmp_proto_impl == 2)
|
||||
{
|
||||
rtmpProtoImplType = RTMP_LIBRTMP;
|
||||
}
|
||||
@@ -1864,7 +1864,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, uin
|
||||
free(swfVfy);
|
||||
}
|
||||
|
||||
if (2 == haveNativeProto)
|
||||
if (haveNativeProto == 2)
|
||||
{
|
||||
int len = strlen(baseUri) + 2 + 1;
|
||||
filename = malloc(len);
|
||||
|
@@ -213,7 +213,7 @@ static int kbhit(void)
|
||||
FD_SET(0, &readfds);
|
||||
FD_SET(g_pfd[0], &readfds);
|
||||
|
||||
if (-1 == select(g_pfd[0] + 1, &readfds, NULL, NULL, &tv))
|
||||
if (select(g_pfd[0] + 1, &readfds, NULL, NULL, &tv) == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -253,7 +253,7 @@ static void SetNice(int prio)
|
||||
sched_setscheduler(0, SCHED_RR, ¶m);
|
||||
#else
|
||||
//int prevPrio = getpriority(PRIO_PROCESS, 0);
|
||||
if (-1 == setpriority(PRIO_PROCESS, 0, prio))
|
||||
if (setpriority(PRIO_PROCESS, 0, prio) == -1)
|
||||
{
|
||||
printf("setpriority - failed\n");
|
||||
}
|
||||
@@ -390,7 +390,7 @@ static int HandleTracks(const Manager_t *ptrManager, const PlaybackCmd_t playbac
|
||||
ok = sscanf(argvBuff + 1, "%d", &id);
|
||||
}
|
||||
|
||||
if (id >= 0 || (1 == ok && id == -1))
|
||||
if (id >= 0 || (ok == 1 && id == -1))
|
||||
{
|
||||
commandRetVal = g_player->playback->Command(g_player, playbackSwitchCmd, (void *)&id);
|
||||
E2iSendMsg("{\"%c_%c\":{\"id\":%d,\"sts\":%d}}\n", argvBuff[0], 's', id, commandRetVal);
|
||||
@@ -843,7 +843,7 @@ int main(int argc, char *argv[])
|
||||
case 'o':
|
||||
{
|
||||
int flags = 0;
|
||||
if (1 == sscanf(argvBuff + 1, "%d", &flags))
|
||||
if (sscanf(argvBuff + 1, "%d", &flags) == 1)
|
||||
{
|
||||
progressive_playback_set(flags);
|
||||
E2iSendMsg("{\"PROGRESSIVE_DOWNLOAD\":{\"flags\":%d, \"sts\":0}}\n", flags);
|
||||
@@ -1022,7 +1022,7 @@ int main(int argc, char *argv[])
|
||||
free(g_player);
|
||||
}
|
||||
|
||||
if (isTermThreadStarted && 1 == write(g_pfd[1], "x", 1))
|
||||
if (isTermThreadStarted && write(g_pfd[1], "x", 1) == 1)
|
||||
{
|
||||
pthread_join(termThread, NULL);
|
||||
}
|
||||
|
@@ -283,11 +283,11 @@ int32_t LinuxDvbBuffOpen(Context_t *context, char *type, int outfd, void *mtx)
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
if (!strcmp("video", type) && -1 == videofd)
|
||||
if (!strcmp("video", type) && videofd == -1)
|
||||
{
|
||||
videofd = outfd;
|
||||
}
|
||||
else if (!strcmp("audio", type) && -1 == audiofd)
|
||||
else if (!strcmp("audio", type) && audiofd == -1)
|
||||
{
|
||||
audiofd = outfd;
|
||||
}
|
||||
|
@@ -53,7 +53,7 @@
|
||||
void FlushPipe(int pipefd)
|
||||
{
|
||||
char tmp;
|
||||
while (1 == read(pipefd, &tmp, 1));
|
||||
while (read(pipefd, &tmp, 1) == 1);
|
||||
}
|
||||
|
||||
ssize_t WriteExt(WriteV_t _call, int fd, void *data, size_t size)
|
||||
|
@@ -276,7 +276,7 @@ static int32_t writeData(void *_call)
|
||||
iov[2].iov_len = SubFrameLen;
|
||||
|
||||
//write the PCM data
|
||||
if (16 == pcmPrivateData->bits_per_coded_sample)
|
||||
if (pcmPrivateData->bits_per_coded_sample == 16)
|
||||
{
|
||||
for (n = 0; n < SubFrameLen; n += 2)
|
||||
{
|
||||
|
@@ -99,7 +99,7 @@ int InsertPesHeader(unsigned char *data, int size, unsigned char stream_id, unsi
|
||||
PutBits(&ld2, 0x1, 8); // Start Code
|
||||
PutBits(&ld2, stream_id, 8); // Stream_id = Audio Stream
|
||||
//4
|
||||
if (-1 == size)
|
||||
if (size == -1)
|
||||
{
|
||||
PutBits(&ld2, 0x0, 16);
|
||||
}
|
||||
|
Reference in New Issue
Block a user