From dfe8d1d37fd07ece2195b09a4a5f1f4ab95e4862 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sun, 14 Aug 2022 17:54:02 +0000 Subject: [PATCH] CWFs --- src/playervideolive.cc | 28 ++++++++++++++-------------- src/teletextdecodervbiebu.h | 8 ++++---- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/playervideolive.cc b/src/playervideolive.cc index 32db4a1..7ec0bb2 100644 --- a/src/playervideolive.cc +++ b/src/playervideolive.cc @@ -735,8 +735,8 @@ void PlayerVideoLive::threadMethod() video->seth264mode(h264); bool dolby = false; - int selected = -1; - int prefered = -1; + i4 selected = -1; // FIXME: If selected were u4 none of these casts would be necessary + i4 prefered = -1; Control* control = Control::getInstance(); @@ -748,7 +748,7 @@ void PlayerVideoLive::threadMethod() int newpref = control->getLangPref(false, chan->dpids[j].desc); if (Audio::getInstance()->streamTypeSupported(toi4(chan->dpids[j].type)) && (prefered < 0 || newpref < prefered)) { - selected = j; + selected = toi4(j); dolby=true; prefered = newpref; } @@ -762,9 +762,9 @@ void PlayerVideoLive::threadMethod() while (j < chan->numAPids) { int newpref = control->getLangPref(false, chan->apids[j].desc); - if (Audio::getInstance()->streamTypeSupported(chan->apids[j].type) && (prefered < 0 || newpref < prefered)) + if (Audio::getInstance()->streamTypeSupported(toi4(chan->apids[j].type)) && (prefered < 0 || newpref < prefered)) { - selected = j; + selected = toi4(j); dolby = false; prefered = newpref; } @@ -776,17 +776,17 @@ void PlayerVideoLive::threadMethod() { if (dolby) { - demuxer->setAID(chan->dpids[selected].pid, 1, chan->dpids[selected].type, true); + demuxer->setAID(toi4(chan->dpids[tou4(selected)].pid), 1, toi4(chan->dpids[tou4(selected)].type), true); audio->setStreamType(Audio::MPEG2_PES); logger->debug(TAG, "Demuxer pids: {} {} (ac3) {}", - chan->vpid, chan->dpids[selected].pid, chan->dpids[selected].type); + chan->vpid, chan->dpids[tou4(selected)].pid, chan->dpids[tou4(selected)].type); } else { - demuxer->setAID(chan->apids[selected].pid, 0, chan->apids[selected].type, true); + demuxer->setAID(toi4(chan->apids[tou4(selected)].pid), 0, toi4(chan->apids[tou4(selected)].type), true); audio->setStreamType(Audio::MPEG2_PES); - logger->debug(TAG, "Demuxer pids: {} {} {}", chan->vpid, chan->apids[selected].pid, - chan->apids[selected].type); + logger->debug(TAG, "Demuxer pids: {} {} {}", chan->vpid, chan->apids[tou4(selected)].pid, + chan->apids[tou4(selected)].type); } } else @@ -804,7 +804,7 @@ void PlayerVideoLive::threadMethod() int newpref = control->getLangPref(true, chan->spids[j].desc); if ((prefered < 0 || newpref < prefered)) { - selected = j; + selected = toi4(j); prefered = newpref; } j++; @@ -813,7 +813,7 @@ void PlayerVideoLive::threadMethod() if (selected >= 0) { - demuxer->setSubID(chan->spids[selected].pid); + demuxer->setSubID(toi4(chan->spids[tou4(selected)].pid)); if (firstStart) { @@ -835,7 +835,7 @@ void PlayerVideoLive::threadMethod() } } - demuxer->setTID(chan->tpid); + demuxer->setTID(toi4(chan->tpid)); teletext->ResetDecoder(); int streamSuccess = vdr->streamChannel(chan->number, this); if (!checkError() && !streamSuccess) @@ -868,7 +868,7 @@ void PlayerVideoLive::threadMethod() { // logger->log("PlayerVideoLive", Log::DEBUG, "chunk mark3"); ++preBufferCount; - u4 percentDone = (preBufferCount * 100) / preBufferAmount; + u4 percentDone = tou4((preBufferCount * 100) / preBufferAmount); logger->debug(TAG, "Prebuffering {}%", percentDone); Message* m = new Message(); diff --git a/src/teletextdecodervbiebu.h b/src/teletextdecodervbiebu.h index f4722ef..7cc32a3 100644 --- a/src/teletextdecodervbiebu.h +++ b/src/teletextdecodervbiebu.h @@ -181,16 +181,16 @@ public: inline enumTeletextColor GetFGColor() { return static_cast((c&FGCOLOR) >> LowestSet32Bit(FGCOLOR)); } inline void SetFGColor(enumTeletextColor fgc) - { c=(c&~FGCOLOR) | (fgc << LowestSet32Bit(FGCOLOR)); } + { c=(c&~FGCOLOR) | tou4(fgc << LowestSet32Bit(FGCOLOR)); } inline cTeletextChar ToFGColor(enumTeletextColor fgc) - { return cTeletextChar((c&~FGCOLOR) | (fgc << LowestSet32Bit(FGCOLOR))); } + { return cTeletextChar((c&~FGCOLOR) | tou4(fgc << LowestSet32Bit(FGCOLOR))); } inline enumTeletextColor GetBGColor() { return static_cast((c&BGCOLOR) >> LowestSet32Bit(BGCOLOR)); } inline void SetBGColor(enumTeletextColor bgc) - { c=(c&~BGCOLOR) | (bgc << LowestSet32Bit(BGCOLOR)); } + { c=(c&~BGCOLOR) | tou4(bgc << LowestSet32Bit(BGCOLOR)); } inline cTeletextChar ToBGColor(enumTeletextColor bgc) - { return cTeletextChar((c&~BGCOLOR) | (bgc << LowestSet32Bit(BGCOLOR))); } + { return cTeletextChar((c&~BGCOLOR) | tou4(bgc << LowestSet32Bit(BGCOLOR))); } inline bool GetBoxedOut() { return c&BOXOUT; } -- 2.39.5