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:
vanhofen
2024-03-25 06:37:01 +01:00
parent 87b08ccfd3
commit 87b2a5dbe3
7 changed files with 16 additions and 16 deletions

View File

@@ -573,7 +573,7 @@ void cPlayback::FindAllPids(uint16_t *apids, unsigned short *ac3flags, uint16_t
{ {
int _pid; int _pid;
char _lang[strlen(TrackList[i])]; 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; apids[j] = _pid;
// atUnknown, atMPEG, atMP3, atAC3, atDTS, atAAC, atPCM, atOGG, atFLAC // 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; int _pid;
char _lang[strlen(TrackList[i])]; 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; pids[j] = _pid;
language[j] = std::string(_lang); language[j] = std::string(_lang);

View File

@@ -1393,7 +1393,7 @@ static void FFMPEGThread(Context_t *context)
do_seek_target_bytes = 1; do_seek_target_bytes = 1;
bEndProcess = 0; bEndProcess = 0;
} }
else if (1 == context->playback->isLoopMode) else if (context->playback->isLoopMode == 1)
{ {
int64_t tmpLength = 0; int64_t tmpLength = 0;
if (container_ffmpeg_get_length(context, &tmpLength) == 0 && tmpLength > 0 && get_play_pts() > 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; rtmpProtoImplType = RTMP_NATIVE;
} }
if (1 == rtmp_proto_impl) if (rtmp_proto_impl == 1)
{ {
rtmpProtoImplType = RTMP_NATIVE; rtmpProtoImplType = RTMP_NATIVE;
} }
else if (2 == rtmp_proto_impl) else if (rtmp_proto_impl == 2)
{ {
rtmpProtoImplType = RTMP_LIBRTMP; rtmpProtoImplType = RTMP_LIBRTMP;
} }
@@ -1864,7 +1864,7 @@ int32_t container_ffmpeg_init_av_context(Context_t *context, char *filename, uin
free(swfVfy); free(swfVfy);
} }
if (2 == haveNativeProto) if (haveNativeProto == 2)
{ {
int len = strlen(baseUri) + 2 + 1; int len = strlen(baseUri) + 2 + 1;
filename = malloc(len); filename = malloc(len);

View File

@@ -213,7 +213,7 @@ static int kbhit(void)
FD_SET(0, &readfds); FD_SET(0, &readfds);
FD_SET(g_pfd[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; return 0;
} }
@@ -253,7 +253,7 @@ static void SetNice(int prio)
sched_setscheduler(0, SCHED_RR, &param); sched_setscheduler(0, SCHED_RR, &param);
#else #else
//int prevPrio = getpriority(PRIO_PROCESS, 0); //int prevPrio = getpriority(PRIO_PROCESS, 0);
if (-1 == setpriority(PRIO_PROCESS, 0, prio)) if (setpriority(PRIO_PROCESS, 0, prio) == -1)
{ {
printf("setpriority - failed\n"); 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); 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); commandRetVal = g_player->playback->Command(g_player, playbackSwitchCmd, (void *)&id);
E2iSendMsg("{\"%c_%c\":{\"id\":%d,\"sts\":%d}}\n", argvBuff[0], 's', id, commandRetVal); 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': case 'o':
{ {
int flags = 0; int flags = 0;
if (1 == sscanf(argvBuff + 1, "%d", &flags)) if (sscanf(argvBuff + 1, "%d", &flags) == 1)
{ {
progressive_playback_set(flags); progressive_playback_set(flags);
E2iSendMsg("{\"PROGRESSIVE_DOWNLOAD\":{\"flags\":%d, \"sts\":0}}\n", flags); E2iSendMsg("{\"PROGRESSIVE_DOWNLOAD\":{\"flags\":%d, \"sts\":0}}\n", flags);
@@ -1022,7 +1022,7 @@ int main(int argc, char *argv[])
free(g_player); 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); pthread_join(termThread, NULL);
} }

View File

@@ -283,11 +283,11 @@ int32_t LinuxDvbBuffOpen(Context_t *context, char *type, int outfd, void *mtx)
if (!ret) if (!ret)
{ {
if (!strcmp("video", type) && -1 == videofd) if (!strcmp("video", type) && videofd == -1)
{ {
videofd = outfd; videofd = outfd;
} }
else if (!strcmp("audio", type) && -1 == audiofd) else if (!strcmp("audio", type) && audiofd == -1)
{ {
audiofd = outfd; audiofd = outfd;
} }

View File

@@ -53,7 +53,7 @@
void FlushPipe(int pipefd) void FlushPipe(int pipefd)
{ {
char tmp; 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) ssize_t WriteExt(WriteV_t _call, int fd, void *data, size_t size)

View File

@@ -276,7 +276,7 @@ static int32_t writeData(void *_call)
iov[2].iov_len = SubFrameLen; iov[2].iov_len = SubFrameLen;
//write the PCM data //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) for (n = 0; n < SubFrameLen; n += 2)
{ {

View File

@@ -99,7 +99,7 @@ int InsertPesHeader(unsigned char *data, int size, unsigned char stream_id, unsi
PutBits(&ld2, 0x1, 8); // Start Code PutBits(&ld2, 0x1, 8); // Start Code
PutBits(&ld2, stream_id, 8); // Stream_id = Audio Stream PutBits(&ld2, stream_id, 8); // Stream_id = Audio Stream
//4 //4
if (-1 == size) if (size == -1)
{ {
PutBits(&ld2, 0x0, 16); PutBits(&ld2, 0x0, 16);
} }