From 87b2a5dbe30d30ce49666c5cb8b11510e02e3258 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 25 Mar 2024 06:37:01 +0100 Subject: [PATCH] addition to "small fix" Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/0737aa3ba617a7bf6fe8c5663ccd42b2bf8aa326 Author: vanhofen 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 --- libarmbox/playback_libeplayer3.cpp | 4 ++-- libeplayer3/container/container_ffmpeg.c | 8 ++++---- libeplayer3/main/exteplayer.c | 10 +++++----- libeplayer3/output/linuxdvb_buffering.c | 4 ++-- libeplayer3/output/writer/common/writer.c | 2 +- libeplayer3/output/writer/sh4/pcm.c | 2 +- libeplayer3/output/writer/sh4/pes.c | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/libarmbox/playback_libeplayer3.cpp b/libarmbox/playback_libeplayer3.cpp index 4d43212..6d3ac35 100644 --- a/libarmbox/playback_libeplayer3.cpp +++ b/libarmbox/playback_libeplayer3.cpp @@ -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); diff --git a/libeplayer3/container/container_ffmpeg.c b/libeplayer3/container/container_ffmpeg.c index b5f9ae1..01d9e67 100644 --- a/libeplayer3/container/container_ffmpeg.c +++ b/libeplayer3/container/container_ffmpeg.c @@ -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); diff --git a/libeplayer3/main/exteplayer.c b/libeplayer3/main/exteplayer.c index 5e8bf87..94855ae 100644 --- a/libeplayer3/main/exteplayer.c +++ b/libeplayer3/main/exteplayer.c @@ -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); } diff --git a/libeplayer3/output/linuxdvb_buffering.c b/libeplayer3/output/linuxdvb_buffering.c index c099723..2e691c9 100644 --- a/libeplayer3/output/linuxdvb_buffering.c +++ b/libeplayer3/output/linuxdvb_buffering.c @@ -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; } diff --git a/libeplayer3/output/writer/common/writer.c b/libeplayer3/output/writer/common/writer.c index 63fcb19..27e1399 100644 --- a/libeplayer3/output/writer/common/writer.c +++ b/libeplayer3/output/writer/common/writer.c @@ -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) diff --git a/libeplayer3/output/writer/sh4/pcm.c b/libeplayer3/output/writer/sh4/pcm.c index 551e910..4207fbf 100644 --- a/libeplayer3/output/writer/sh4/pcm.c +++ b/libeplayer3/output/writer/sh4/pcm.c @@ -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) { diff --git a/libeplayer3/output/writer/sh4/pes.c b/libeplayer3/output/writer/sh4/pes.c index 5ce53aa..4509461 100644 --- a/libeplayer3/output/writer/sh4/pes.c +++ b/libeplayer3/output/writer/sh4/pes.c @@ -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); }