before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(CurrentHostCounter() - m_timestamp.get_nanoTime()) < 2 * 1000 * 1000 * 1000)
{
if (usesAdvancedLogging)
{
CLog::Log(LOGDEBUG, "Framecounter: {} Time: {} Current-Time: {}",
(m_timestamp.get_framePosition() & UINT64_LOWER_BYTES), m_timestamp.get_nanoTime(),
... | ```suggestion
const double playtime = m_timestampPos / static_cast<double>(m_sink_sampleRate);
``` | (CurrentHostCounter() - m_timestamp.get_nanoTime()) < 2 * 1000 * 1000 * 1000)
{
if (usesAdvancedLogging)
{
CLog::Log(LOGDEBUG, "Framecounter: {} Time: {} Current-Time: {}",
(m_timestamp.get_framePosition() & UINT64_LOWER_BYTES),
m_timestamp.get_nanoTim... | @@ -672,85 +672,95 @@ void CAESinkAUDIOTRACK::GetDelay(AEDelayStatus& status)
double delay = m_duration_written - gone;
- if (m_stampTimer.IsTimePast())
+ // latency works way better but is not available everyhwere
+ int latency = m_at_jni->getLatency();
+ const bool isRawPt = m_passthrough && !m_info.m_want... | xbmc/cores/AudioEngine/Sinks/AESinkAUDIOTRACK.cpp | 26 | C++ | 1 | suggestion | 106 | 51 | 51 | false | AESinkAudiotrack: Implement GetLatency API | 27,638 | xbmc/xbmc | 17,740 | C++ | thexai | fritsch |
addon ? addon->ID() : "unknown");
return;
}
Interface_GUIGeneral::lock();
const CGUIWindow* pWindow =
CServiceBroker::GetGUI()->GetWindowManager().GetWindow(pAddonWindow->GetID());
if (pWindow)
{
// first change to an existing window
if (CServiceBroker::GetGUI()->GetWindowMan... | Is the `FreeResources` call still needed, now that we call `Delete`instead of `Remove`? | addon ? addon->ID() : "unknown");
return;
}
Interface_GUIGeneral::lock();
const CGUIWindow* pWindow =
CServiceBroker::GetGUI()->GetWindowManager().GetWindow(pAddonWindow->GetID());
if (pWindow)
{
// first change to an existing window
if (CServiceBroker::GetGUI()->GetWindowMan... | @@ -232,9 +232,8 @@ void Interface_GUIWindow::destroy(KODI_HANDLE kodiBase, KODI_GUI_WINDOW_HANDLE h
// free the window's resources and unload it (free all guicontrols)
pAddonWindow->FreeResources(true);
- CServiceBroker::GetGUI()->GetWindowManager().Remove(pAddonWindow->GetID());
+ CServiceBroker::Ge... | xbmc/addons/interfaces/gui/Window.cpp | 26 | C++ | 0.571 | question | 87 | 51 | 51 | false | [Addons] Avoid delete since window ownership belongs to CGUIWindowMan… | 27,656 | xbmc/xbmc | 17,740 | C++ | ksooo | enen92 |
- (void)windowDidEndLiveResize:(NSNotification*)notification
{
EnableRenderGUI(true);
}
- (void)windowDidMiniaturize:(NSNotification*)aNotification
{
g_application.m_AppFocused = false;
EnableRenderGUI(false);
}
- (void)windowDidDeminiaturize:(NSNotification*)aNotification
{
g_application.m_AppFocused = tru... | extracting this bool expression to a method would be better I think |
- (void)windowDidEndLiveResize:(NSNotification*)notification
{
EnableRenderGUI(true);
}
- (void)windowDidMiniaturize:(NSNotification*)aNotification
{
g_application.m_AppFocused = false;
EnableRenderGUI(false);
}
- (void)windowDidDeminiaturize:(NSNotification*)aNotification
{
g_application.m_AppFocused = tru... | @@ -116,7 +116,7 @@ - (void)windowDidBecomeKey:(NSNotification*)aNotification
g_application.m_AppFocused = true;
CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::GUI, "WindowFocused");
- EnableRenderGUI(true);
+ EnableRenderGUI(self.window.occlusionState & NSWindowOcclusionStateVisible); | xbmc/windowing/osx/OpenGL/WindowControllerMacOS.mm | 26 | Objective-C++ | 0.357 | refactor | 67 | 51 | 51 | false | [macOS] Only disable GUI rendering if the window is not visible | 27,658 | xbmc/xbmc | 17,740 | C++ | kambala-decapitator | enen92 |
/* Release the previous allocations */
/* Create a new audio client */
hr = m_pDevice->Activate(m_pAudioClient.ReleaseAndGetAddressOf());
if (FAILED(hr))
{
CLog::LogF(LOGERROR, "Device Activation Failed : {}", CWIN32Util::FormatHRESULT(hr));
return false;
}
/* Open the stream an... | They seemed to have needed that stuff, as: https://github.com/thexai/xbmc/blob/e94d20a182434ac78da09ea3ebc8b60b8c9b4eb5/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp#L165 seems to be very picky? Did it harm? | audioSinkBufferDurationMsec = (REFERENCE_TIME) ((10000.0 * 1000 / wfxex.Format.nSamplesPerSec * m_uiBufferLen) + 0.5);
/* Release the previous allocations */
/* Create a new audio client */
hr = m_pDevice->Activate(m_pAudioClient.ReleaseAndGetAddressOf());
if (FAILED(hr))
{
CLog::LogF(LOG... | @@ -882,8 +882,6 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format)
else
audioSinkBufferDurationMsec = (REFERENCE_TIME)200000; // 20ms period (same as XAudio and DSound)
- audioSinkBufferDurationMsec = (REFERENCE_TIME)((audioSinkBufferDurationMsec / format.m_frameSize) * format.m_frameSize); /... | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 0.357 | question | 207 | 51 | 51 | false | [Windows] WASAPI rework | 27,675 | xbmc/xbmc | 17,740 | C++ | fritsch | thexai |
else
{
// planar formats are currently not supported by this sink
format.m_dataFormat = AE_FMT_FLOAT;
CAESinkFactoryWin::BuildWaveFormatExtensible(format, wfxex);
}
// Prevents NULL speaker mask. To do: debug exact cause.
// When this happens requested AE format is AE_FMT_FLOAT + channel layout
... | Why not but I'd say in another PR to change XAudio at the same time, and it'd be better if the default came from AE / somewhere in Kodi that knows 48kHz is best.
I have no idea what the linux sinks do. | // planar formats are currently not supported by this sink
format.m_dataFormat = AE_FMT_FLOAT;
CAESinkFactoryWin::BuildWaveFormatExtensible(format, wfxex);
}
// Prevents NULL speaker mask. To do: debug exact cause.
// When this happens requested AE format is AE_FMT_FLOAT + channel layout
// RAW, RA... | @@ -687,16 +687,16 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format)
format.m_dataFormat >= AE_FMT_MAX ||
format.m_channelLayout.Count() == 0)
{
- wfxex.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
- wfxex.Format.nChannels = 2;
- wfxex.Format.nSamplesPerSec ... | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 0.571 | suggestion | 201 | 51 | 51 | false | [Windows] WASAPI rework | 27,675 | xbmc/xbmc | 17,740 | C++ | CrystalP | thexai |
* separators = "'"
* token = Le
*/
const std::string token = addonExtensions.GetValue("token").asString();
if (!token.empty())
{
std::string separators = addonExtensions.GetValue("token@separators").asString();
if (separators.empty())
separators = " .... | Looking at this check, it doesn't seem like `skin` is used later? Also, `CServiceBroker::GetGUI()` can return null I think, so should the GUI be checked for outside guilib? | * token = Le
*/
const std::string token = addonExtensions.GetValue("token").asString();
if (!token.empty())
{
std::string separators = addonExtensions.GetValue("token@separators").asString();
if (separators.empty())
separators = " ._";
for (auto separ... | @@ -100,7 +101,8 @@ bool CLanguageResource::IsInUse() const
void CLanguageResource::OnPostInstall(bool update, bool modal)
{
- if (!g_SkinInfo)
+ auto skin = CServiceBroker::GetGUI()->GetSkinInfo();
+ if (!skin) | xbmc/addons/LanguageResource.cpp | 26 | C++ | 1 | question | 172 | 51 | 51 | false | [GUI] Kill g_SkinInfo global, move to CGUIComponent | 27,707 | xbmc/xbmc | 17,740 | C++ | garbear | enen92 |
return true;
}
int CSkinInfo::GetFirstWindow() const
{
int startWindow = GetStartWindow();
if (HasSkinFile("Startup.xml"))
startWindow = WINDOW_STARTUP_ANIM;
return startWindow;
}
bool CSkinInfo::IsInUse() const
{
// Could extend this to prompt for reverting to the standard skin perhaps
return CServic... | ```c++
const bool skinLoaded = static_cast<bool>(skin);
```
Which keeps type correctness by making types explicit instead of implicit. Comparing a shared_ptr to nullptr does some unexpected casting. | return true;
}
int CSkinInfo::GetFirstWindow() const
{
int startWindow = GetStartWindow();
if (HasSkinFile("Startup.xml"))
startWindow = WINDOW_STARTUP_ANIM;
return startWindow;
}
bool CSkinInfo::IsInUse() const
{
// Could extend this to prompt for reverting to the standard skin perhaps
return CServic... | @@ -406,15 +404,17 @@ const INFO::CSkinVariableString* CSkinInfo::CreateSkinVariable(const std::string
void CSkinInfo::OnPreInstall()
{
- bool skinLoaded = g_SkinInfo != nullptr;
- if (IsInUse() && skinLoaded)
+ auto skin = CServiceBroker::GetGUI()->GetSkinInfo();
+ const bool skinLoaded = skin != nullptr; | xbmc/addons/Skin.cpp | 26 | C++ | 1 | bug | 199 | 51 | 51 | false | [GUI] Kill g_SkinInfo global, move to CGUIComponent | 27,707 | xbmc/xbmc | 17,740 | C++ | garbear | enen92 |
CLog::Log(LOGERROR, "CGUIDialogAudioSettings: unable to setup settings");
return;
}
// get all necessary setting groups
const std::shared_ptr<CSettingGroup> groupAudio = AddGroup(category);
if (groupAudio == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogAudioSettings: unable to setup settings");
ret... | A ternary with false can be more simply written:
```c++
const bool usePopup = skin && skin->HasSkinFile("DialogSlider.xml");
```
And in other spots. | CLog::Log(LOGERROR, "CGUIDialogAudioSettings: unable to setup settings");
return;
}
// get all necessary setting groups
const std::shared_ptr<CSettingGroup> groupAudio = AddGroup(category);
if (groupAudio == NULL)
{
CLog::Log(LOGERROR, "CGUIDialogAudioSettings: unable to setup settings");
ret... | @@ -226,7 +227,8 @@ void CGUIDialogAudioSettings::InitializeSettings()
return;
}
- bool usePopup = g_SkinInfo->HasSkinFile("DialogSlider.xml");
+ auto skin = CServiceBroker::GetGUI()->GetSkinInfo();
+ bool usePopup = skin ? skin->HasSkinFile("DialogSlider.xml") : false; | xbmc/video/dialogs/GUIDialogAudioSettings.cpp | 26 | C++ | 1 | suggestion | 150 | 51 | 51 | false | [GUI] Kill g_SkinInfo global, move to CGUIComponent | 27,707 | xbmc/xbmc | 17,740 | C++ | garbear | enen92 |
{
// Requested buffer was too large, try again with a duration reduced by the min device period
audioSinkBufferDurationHns -= hnsMinimumDevicePeriod;
needNewClient = false;
}
else
{
break;
}
}
if (FAILED(hr))
{
CLog::LogF(LOGERROR, "Failed to initialize WASAPI in e... | This removed code was OK.
Wait half of Delay() (one buffer) to WASAPI finish to play current buffer.
For period 20ms --> GetDelay() = 40ms * 500 = 0.02 seg
`KODI::TIME::Sleep` blocks/wait 20ms to assure buffer of 20ms is finished play.
Easy and effective. The new code adds much complication and doesn't solv... | CLog::Log(LOGDEBUG, " Channel Layout : {}", ((std::string)format.m_channelLayout));
CLog::Log(LOGDEBUG, " Enc. Channels : {}", wfxex_iec61937.dwEncodedChannelCount);
CLog::Log(LOGDEBUG, " Enc. Samples/Sec: {}", wfxex_iec61937.dwEncodedSamplesPerSec);
CLog::Log(LOGDEBUG, " Channel Mask : {}", w... | @@ -983,34 +1041,90 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format)
CLog::Log(LOGDEBUG, " Channel Mask : {}", wfxex.dwChannelMask);
CLog::Log(LOGDEBUG, " Frames : {}", m_uiBufferLen);
CLog::Log(LOGDEBUG, " Frame Size : {}", format.m_frameSize);
- CLog::Log(LOGDEBUG, " Pe... | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 0.857 | suggestion | 1,647 | 51 | 51 | false | [Windows] WASAPI Sink Buffer Size Improvements | 27,719 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
m_isDirty = true;
return INT_MAX;
}
// fill buffer
memcpy(buf, m_bufferPtr == 0 ? buffer : m_buffer.data(),
m_format.m_frames * m_format.m_frameSize);
m_bufferPtr = 0;
// pass back to the audio driver
hr = m_pRenderClient->ReleaseBuffer(m_format.m_frames, 0);
if (FAILED(hr))
{
CLo... | While I think it could be a good idea, I don't think this is the right place (AddPackets). I believe this should be done when initializing the sink, and possibly investing more time and moving the code to:
https://github.com/xbmc/xbmc/blob/master/xbmc/platform/win32/threads/ThreadImplWin.cpp
Maybe create new method h... | m_sinkFrames += m_format.m_frames;
// if not running start the audio driver
if (!m_running)
{
hr = m_pAudioClient->Start();
if (FAILED(hr))
{
CLog::LogF(LOGERROR, "AudioClient Start Failed");
m_isDirty = true;
return INT_MAX;
}
m_running = true;
}
// if not all receiv... | @@ -315,6 +329,16 @@ unsigned int CAESinkWASAPI::AddPackets(uint8_t **data, unsigned int frames, unsi
// if not running start the audio driver
if (!m_running)
{
+#ifdef TARGET_WINDOWS_DESKTOP
+ DWORD taskIndex = 0;
+ m_hTask = AvSetMmThreadCharacteristics(TEXT("Audio"), &taskIndex); | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 1 | suggestion | 697 | 51 | 51 | false | [Windows] WASAPI Sink Buffer Size Improvements | 27,719 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
info.dwFlags = 0;
__try
{
RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
}
}
CWIN32Util::SetThreadLocalLocale(true); // avoid crashing with setlocale(), see https://connect.microsoft.com/VisualSt... | Just as a heads up: Increasing priority only means: Buffers were not big enough. While small buffers and with that small periods have some advantages, but only to a certain degree in menu sounds, needing a higher prio here simply means periods are too small (aim at 32 ms or more) and especially too few (aim at 3 or bet... | /*
* Copyright (C) 2005-2018 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "ThreadImplWin.h"
#include "utils/Map.h"
#include "utils/log.h"
#include "platform/win32/WIN32Util.h"
#include <arra... | @@ -103,3 +113,33 @@ bool CThreadImplWin::SetPriority(const ThreadPriority& priority)
return bReturn;
}
+
+bool CThreadImplWin::SetTask(const ThreadTask& task) | xbmc/platform/win32/threads/ThreadImplWin.cpp | 26 | C++ | 0.643 | suggestion | 605 | 51 | 106 | false | [Windows] WASAPI Sink Buffer Size Improvements | 27,719 | xbmc/xbmc | 17,740 | C++ | fritsch | CrystalP |
const IID IID_IAudioClock = __uuidof(IAudioClock);
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14);
DEFINE_PROPERTYKEY(PKEY_Device_EnumeratorName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 24);
#define EXIT_O... | Maybe rename to `minPcmPeriod` and `minPassthroughPeriod` shorter variables names avoids some line breaks.
Also define inside namespace. | {
constexpr auto minPcmPeriod{20ms};
constexpr auto minPassthroughPeriod{50ms};
} // namespace
const IID IID_IAudioRenderClient = __uuidof(IAudioRenderClient);
const IID IID_IAudioClock = __uuidof(IAudioClock);
DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8,... | @@ -52,6 +53,10 @@ inline void SafeRelease(T **ppT)
}
using namespace Microsoft::WRL;
+using namespace std::chrono_literals;
+
+constexpr auto minPcmBufferDuration = 20ms;
+constexpr auto minPassthroughBufferDuration = 50ms; | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 0.714 | suggestion | 139 | 51 | 51 | false | [Windows] WASAPI Sink Buffer Size Improvements | 27,719 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
const int multiplier = (targetBufferDuration / devicePeriod) +
((targetBufferDuration % devicePeriod == 0ns) ? 0 : 1);
bufferDuration = multiplier * devicePeriod;
if (isPassthrough)
format.m_dataFormat = AE_FMT_S16NE;
auto AudioClientInitialize = [this](REFERENCE_TIME bufferDurati... | Maybe rename to `sinkBufferDurationHns` | bool needNewClient) -> HRESULT
{
if (needNewClient && m_pAudioClient != nullptr)
{
if (HRESULT hr = m_pDevice->Activate(m_pAudioClient.ReleaseAndGetAddressOf()); FAILED(hr))
{
CLog::LogF(LOGERROR, "Device Activation Failed : {}", CWIN32Util::FormatHRES... | @@ -876,49 +881,84 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format)
CLog::LogF(LOGERROR, "unable to set audio category, {}", CWIN32Util::FormatHRESULT(hr));
}
- REFERENCE_TIME audioSinkBufferDurationMsec{};
-
const bool isPassthrough = (format.m_dataFormat == AE_FMT_RAW);
+ const auto ... | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 0.5 | suggestion | 39 | 51 | 51 | false | [Windows] WASAPI Sink Buffer Size Improvements | 27,719 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
if (isPassthrough)
format.m_dataFormat = AE_FMT_S16NE;
auto AudioClientInitialize = [this](REFERENCE_TIME bufferDurationHns, WAVEFORMATEX* format,
bool needNewClient) -> HRESULT
{
if (needNewClient && m_pAudioClient != nullptr)
{
if (HRESULT hr = m_pDevice... | This loop should be changed to do while loop because you want execute always:
```c++
do
{
hr = AudioClientInitialize(...);
}
while (hr != S_OK && sinkBufferDurationHns >= hnsDefaultDevicePeriod);
```
Also the else break; condition it's quite ugly. | {
if (HRESULT hr = m_pDevice->Activate(m_pAudioClient.ReleaseAndGetAddressOf()); FAILED(hr))
{
CLog::LogF(LOGERROR, "Device Activation Failed : {}", CWIN32Util::FormatHRESULT(hr));
return hr;
}
}
const AUDCLNT_SHAREMODE mode = AUDCLNT_SHAREMODE_EXCLUSIVE;
const DWORD f... | @@ -876,49 +881,84 @@ bool CAESinkWASAPI::InitializeExclusive(AEAudioFormat &format)
CLog::LogF(LOGERROR, "unable to set audio category, {}", CWIN32Util::FormatHRESULT(hr));
}
- REFERENCE_TIME audioSinkBufferDurationMsec{};
-
const bool isPassthrough = (format.m_dataFormat == AE_FMT_RAW);
+ const auto ... | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 1 | suggestion | 252 | 51 | 51 | false | [Windows] WASAPI Sink Buffer Size Improvements | 27,719 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
CLog::Log(LOGDEBUG, " Format cBSize : {}", wfxex.Format.cbSize);
CLog::Log(LOGDEBUG, " Channel Layout : {}", ((std::string)format.m_channelLayout));
CLog::Log(LOGDEBUG, " Channel Mask : {}", wfxex.dwChannelMask);
CLog::Log(LOGDEBUG, " Frames : {}", m_uiBufferLen);
CLog::Log(LOGDEBUG, " Fra... | Can `m_sinkLatency` be odd? Maybe should be `m_sinkLatency * 1000 / 2`? |
return true;
}
void CAESinkWASAPI::Drain()
{
if(!m_pAudioClient)
return;
WriteLastBuffer();
// Wait for last data in buffer to play before stopping (current buffer + WriteLastBuffer).
// If WriteLastBuffer() fails, it doesn't matter wait for the time of two buffers anyway.
KODI::TIME::Sleep(std::chr... | @@ -994,10 +994,17 @@ void CAESinkWASAPI::Drain()
if(!m_pAudioClient)
return;
- AEDelayStatus status;
- GetDelay(status);
-
- KODI::TIME::Sleep(std::chrono::milliseconds(static_cast<int>(status.GetDelay() * 500)));
+ if (WriteLastBuffer())
+ {
+ // wait for last data in buffer to play before stopping
... | xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 26 | C++ | 0.571 | performance | 71 | 51 | 51 | false | [WASAPI] Improve Drain() - Allow write pending frames in m_buffer | 27,722 | xbmc/xbmc | 17,740 | C++ | garbear | thexai |
}
void CGUIBaseContainer::UpdateScrollOffset(unsigned int currentTime)
{
if (m_scroller.Update(currentTime))
MarkDirtyRegion();
else if (m_lastScrollStartTimer.IsRunning() && m_lastScrollStartTimer.GetElapsedMilliseconds() >= SCROLLING_GAP)
{
m_scrollTimer.Stop();
m_lastScrollStartTimer.Stop();
S... | Wouldn't it be better to use std::optional instead of defaulting to -1? Then you'd simply be able to do a .reset() |
void CGUIBaseContainer::UpdateScrollOffset(unsigned int currentTime)
{
if (m_scroller.Update(currentTime))
MarkDirtyRegion();
else if (m_lastScrollStartTimer.IsRunning() && m_lastScrollStartTimer.GetElapsedMilliseconds() >= SCROLLING_GAP)
{
m_scrollTimer.Stop();
m_lastScrollStartTimer.Stop();
Set... | @@ -1312,6 +1315,7 @@ void CGUIBaseContainer::Reset()
m_items.clear();
m_lastItem.reset();
ResetAutoScrolling();
+ m_lastPageControlOffset = -1; | xbmc/guilib/GUIBaseContainer.cpp | 26 | C++ | 0.5 | suggestion | 114 | 51 | 51 | false | [guilib] Optimize GUIBaseContainer page control message caching | 27,735 | xbmc/xbmc | 17,740 | C++ | enen92 | pannal |
CGUIControlGroupList::~CGUIControlGroupList(void) = default;
void CGUIControlGroupList::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
if (m_scroller.Update(currentTime))
MarkDirtyRegion();
// first we update visibility of all our items, to ensure our size and
// alignment computations ... | Three variables below can be declared const I guess | CGUIControlGroupList::CGUIControlGroupList(const CGUIControlGroupList& other)
: CGUIControlGroup(other),
m_itemGap(other.m_itemGap),
m_pageControl(other.m_pageControl),
m_focusedPosition(other.m_focusedPosition),
m_totalSize(other.m_totalSize),
m_scroller(other.m_scroller),
m_useControlPositio... | @@ -59,13 +58,28 @@ void CGUIControlGroupList::Process(unsigned int currentTime, CDirtyRegionList &d
ValidateOffset(); // m_totalSize is updated here
bool sizeChanged = previousTotalSize != m_totalSize;
- if (m_pageControl && (m_lastScrollerValue != m_scroller.GetValue() || sizeChanged))
+ if (m_pageControl)
... | xbmc/guilib/GUIControlGroupList.cpp | 26 | C++ | 0.143 | suggestion | 51 | 51 | 51 | false | [guilib] Optimize GUIControlGroupList page control message caching | 27,736 | xbmc/xbmc | 17,740 | C++ | enen92 | pannal |
ProcessText(currentTime);
if (m_bInvalidated)
{
m_imgFocus->SetWidth(GetWidth());
m_imgFocus->SetHeight(m_height);
m_imgNoFocus->SetWidth(GetWidth());
m_imgNoFocus->SetHeight(m_height);
}
if (HasFocus())
{
unsigned int alphaChannel = m_alpha;
if (m_pulseOnSelect)
{
unsign... | Cannot detect unambiguously the first execution since all values of the variable are valid alpha. A second variable is needed, or an optional to keep things tidy. | if (m_bInvalidated)
{
m_imgFocus->SetWidth(GetWidth());
m_imgFocus->SetHeight(m_height);
m_imgNoFocus->SetWidth(GetWidth());
m_imgNoFocus->SetHeight(m_height);
}
if (HasFocus())
{
unsigned int alphaChannel = m_alpha;
if (m_pulseOnSelect)
{
unsigned int alphaCounter = m_focu... | @@ -89,8 +90,14 @@ void CGUIButtonControl::Process(unsigned int currentTime, CDirtyRegionList &dirt
alphaChannel += 192;
alphaChannel = (unsigned int)((float)m_alpha * (float)alphaChannel / 255.0f);
}
- if (m_imgFocus->SetAlpha((unsigned char)alphaChannel))
- MarkDirtyRegion();
+
+ unsigne... | xbmc/guilib/GUIButtonControl.cpp | 26 | C++ | 0.286 | suggestion | 162 | 51 | 51 | false | [guilib] Optimize GUIButtonControl focus pulse alpha updates | 27,737 | xbmc/xbmc | 17,740 | C++ | CrystalP | pannal |
ProcessText(currentTime);
if (m_bInvalidated)
{
m_imgFocus->SetWidth(GetWidth());
m_imgFocus->SetHeight(m_height);
m_imgNoFocus->SetWidth(GetWidth());
m_imgNoFocus->SetHeight(m_height);
}
if (HasFocus())
{
unsigned int alphaChannel = m_alpha;
if (m_pulseOnSelect)
{
unsign... | const auto newAlpha would be appropriate here since the cast repeats the type. | ProcessText(currentTime);
if (m_bInvalidated)
{
m_imgFocus->SetWidth(GetWidth());
m_imgFocus->SetHeight(m_height);
m_imgNoFocus->SetWidth(GetWidth());
m_imgNoFocus->SetHeight(m_height);
}
if (HasFocus())
{
unsigned int alphaChannel = m_alpha;
if (m_pulseOnSelect)
{
unsign... | @@ -89,8 +89,14 @@ void CGUIButtonControl::Process(unsigned int currentTime, CDirtyRegionList &dirt
alphaChannel += 192;
alphaChannel = (unsigned int)((float)m_alpha * (float)alphaChannel / 255.0f);
}
- if (m_imgFocus->SetAlpha((unsigned char)alphaChannel))
- MarkDirtyRegion();
+
+ const u... | xbmc/guilib/GUIButtonControl.cpp | 26 | C++ | 0.429 | suggestion | 78 | 51 | 51 | false | [guilib] Optimize GUIButtonControl focus pulse alpha updates | 27,737 | xbmc/xbmc | 17,740 | C++ | CrystalP | pannal |
}
else
{
CLog::Log(LOGDEBUG, "[threads] name: '{}' priority: {}", m_name, native.name);
bReturn = true;
}
}
return bReturn;
}
bool CThreadImplWin::SetTask(const ThreadTask& task)
{
#ifdef TARGET_WINDOWS_DESKTOP
std::call_once(flag, LogProcessPriorityClass);
const std::wstring taskN... | This code is for convert wstring to string?
Generates a lot of compile warnings:
```
1> V:\kodi\xbmc\platform\win32\threads\ThreadImplWin.cpp(186,24):
1> see reference to function template instantiation 'std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string<std::_String_const... | }
else
{
CLog::Log(LOGDEBUG, "[threads] name: '{}' priority: {}", m_name, native.name);
bReturn = true;
}
}
return bReturn;
}
bool CThreadImplWin::SetTask(const ThreadTask& task)
{
#ifdef TARGET_WINDOWS_DESKTOP
std::call_once(flag, LogProcessPriorityClass);
std::string_view taskNam... | @@ -90,16 +137,75 @@ void CThreadImplWin::SetThreadInfo(const std::string& name)
}
}
- CWIN32Util::SetThreadLocalLocale(true); // avoid crashing with setlocale(), see https://connect.microsoft.com/VisualStudio/feedback/details/794122
+ // avoid crashing with setlocale(), see https://connect.microsoft.com/Vi... | xbmc/platform/win32/threads/ThreadImplWin.cpp | 26 | C++ | 1 | suggestion | 2,075 | 51 | 51 | false | [Threading][Windows] Log app/thread priorities and use MMCSS for AE Sink | 27,748 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
/*
* Copyright (C) 2005-2026 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "ThreadImplWin.h"
#include "CharsetConverter.h"
#include "utils/Map.h"
#include "utils/log.h"
#include "platform/win3... | Seems this should be `#include "platform/win32/CharsetConverter.h"` | /*
* Copyright (C) 2005-2026 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "ThreadImplWin.h"
#include "utils/Map.h"
#include "utils/log.h"
#include "platform/win32/CharsetConverter.h"
#include... | @@ -8,33 +8,55 @@
#include "ThreadImplWin.h"
+#include "CharsetConverter.h" | xbmc/platform/win32/threads/ThreadImplWin.cpp | 11 | C++ | 0.571 | suggestion | 67 | 36 | 36 | false | [Threading][Windows] Log app/thread priorities and use MMCSS for AE Sink | 27,748 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
{
return it->second;
}
else
{
throw std::range_error("Priority not found");
}
}
void LogProcessPriorityClass()
{
const DWORD prioClass = GetPriorityClass(GetCurrentProcess());
if (prioClass == 0)
{
CLog::LogF(LOGERROR, "unable to retrieve the process priority class ({})", GetLastError());
... | ```suggestion
const std::string ThreadTaskToNativeTask(ThreadTask task)
``` | return it->second;
}
else
{
throw std::range_error("Priority not found");
}
}
void LogProcessPriorityClass()
{
const DWORD prioClass = GetPriorityClass(GetCurrentProcess());
if (prioClass == 0)
{
CLog::LogF(LOGERROR, "unable to retrieve the process priority class ({})", GetLastError());
... | @@ -47,6 +69,32 @@ constexpr int ThreadPriorityToNativePriority(const ThreadPriority& priority)
}
}
+void LogProcessPriorityClass()
+{
+ const DWORD prioClass = GetPriorityClass(GetCurrentProcess());
+
+ if (prioClass == 0)
+ {
+ CLog::LogF(LOGERROR, "unable to retrieve the process priority class ({})", Get... | xbmc/platform/win32/threads/ThreadImplWin.cpp | 26 | C++ | 1 | suggestion | 75 | 51 | 51 | false | [Threading][Windows] Log app/thread priorities and use MMCSS for AE Sink | 27,748 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
std::unique_lock lock(m_criticalSection);
if (m_handle)
{
const NativeThreadPriority native = ThreadPriorityToNativePriority(priority);
if (SetThreadPriority(m_handle, native.priority) == 0)
{
CLog::LogF(LOGERROR, "unable to set the priority of thread {} ({})", m_name, GetLastError());
b... | ```suggestion
const std::string& taskName = ThreadTaskToNativeTask(task);
```
To avoid create a copy of string.
Is similar case of:
https://github.com/xbmc/xbmc/blob/c21744d2915dbb3f3c34da0d86741d45a0ae6435/xbmc/settings/ServicesSettings.cpp#L21-L22
And many other places. | std::unique_lock lock(m_criticalSection);
if (m_handle)
{
const NativeThreadPriority native = ThreadPriorityToNativePriority(priority);
if (SetThreadPriority(m_handle, native.priority) == 0)
{
CLog::LogF(LOGERROR, "unable to set the priority of thread {} ({})", m_name, GetLastError());
bR... | @@ -90,16 +138,77 @@ void CThreadImplWin::SetThreadInfo(const std::string& name)
}
}
- CWIN32Util::SetThreadLocalLocale(true); // avoid crashing with setlocale(), see https://connect.microsoft.com/VisualStudio/feedback/details/794122
+ // avoid crashing with setlocale(), see https://connect.microsoft.com/Vi... | xbmc/platform/win32/threads/ThreadImplWin.cpp | 26 | C++ | 1 | suggestion | 285 | 51 | 51 | false | [Threading][Windows] Log app/thread priorities and use MMCSS for AE Sink | 27,748 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
void OnDXDeviceRestored() override;
// CRenderSystemDX methods
CGUIShaderDX* GetGUIShader() const { return m_pGUIShader; }
bool IsFormatSupport(DXGI_FORMAT format, unsigned int usage) const;
CRect GetBackBufferRect();
CD3DTexture& GetBackBuffer();
void FlushGPU() const;
void RequestDecodingTime();
v... | This not seems quite common. Maybe is enough return underlaying `ID3D11DepthStencilState` interface.
```suggestion
ID3D11DepthStencilState* GetDepthStencilState() const;
``` | void OnDXDeviceRestored() override;
// CRenderSystemDX methods
CGUIShaderDX* GetGUIShader() const { return m_pGUIShader; }
bool IsFormatSupport(DXGI_FORMAT format, unsigned int usage) const;
CRect GetBackBufferRect();
CD3DTexture& GetBackBuffer();
void FlushGPU() const;
void RequestDecodingTime();
v... | @@ -77,6 +79,7 @@ class CRenderSystemDX : public CRenderSystemBase, DX::IDeviceNotify
void OnResize();
void CheckInterlacedStereoView(void);
void CheckDeviceCaps();
+ Microsoft::WRL::ComPtr<ID3D11DepthStencilState> GetDepthStencilState(); | xbmc/rendering/dx/RenderSystemDX.h | 26 | C/C++ | 1 | suggestion | 173 | 51 | 51 | false | [Windows] D3D11 Implementation of Front to Back Rendering | 27,751 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
, MathUtils::round_int(rect.y1)
, MathUtils::round_int(rect.x2)
, MathUtils::round_int(rect.y2));
m_pContext->RSSetScissorRects(1, &scissor);
m_pContext->RSSetState(m_RSScissorEnable.Get());
m_ScissorsEnabled = true;
}
void CRenderSystemDX::ResetScisso... | ```suggestion
ID3D11DepthStencilState* CRenderSystemDX::GetDepthStencilState()
``` | , MathUtils::round_int(rect.y1)
, MathUtils::round_int(rect.x2)
, MathUtils::round_int(rect.y2));
m_pContext->RSSetScissorRects(1, &scissor);
m_pContext->RSSetState(m_RSScissorEnable.Get());
m_ScissorsEnabled = true;
}
void CRenderSystemDX::ResetScisso... | @@ -541,6 +584,28 @@ void CRenderSystemDX::ResetScissors()
m_ScissorsEnabled = false;
}
+ComPtr<ID3D11DepthStencilState> CRenderSystemDX::GetDepthStencilState() | xbmc/rendering/dx/RenderSystemDX.cpp | 26 | C++ | 0.857 | suggestion | 82 | 51 | 51 | false | [Windows] D3D11 Implementation of Front to Back Rendering | 27,751 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
m_pContext->RSSetState(m_RSScissorEnable.Get());
m_ScissorsEnabled = true;
}
void CRenderSystemDX::ResetScissors()
{
if (!m_bRenderCreated)
return;
auto m_pContext = m_deviceResources->GetD3DContext();
auto outputSize = m_deviceResources->GetOutputSize();
m_scissor.SetRect(0.0f, 0.0f,
static_cast... | ```suggestion
return m_depthStencilStateRO.Get();
```
This and others.
Also remove .Get() from callers. | m_pContext->RSSetState(m_RSScissorEnable.Get());
m_ScissorsEnabled = true;
}
void CRenderSystemDX::ResetScissors()
{
if (!m_bRenderCreated)
return;
auto m_pContext = m_deviceResources->GetD3DContext();
auto outputSize = m_deviceResources->GetOutputSize();
m_scissor.SetRect(0.0f, 0.0f,
static_cast... | @@ -541,6 +584,28 @@ void CRenderSystemDX::ResetScissors()
m_ScissorsEnabled = false;
}
+ComPtr<ID3D11DepthStencilState> CRenderSystemDX::GetDepthStencilState()
+{
+ switch (m_depthCulling)
+ {
+ case DEPTH_CULLING::BACK_TO_FRONT:
+ return m_depthStencilStateRO; | xbmc/rendering/dx/RenderSystemDX.cpp | 26 | C++ | 1 | suggestion | 110 | 51 | 51 | false | [Windows] D3D11 Implementation of Front to Back Rendering | 27,751 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
}
if (pRTView)
{
const auto outputSize = m_deviceResources->GetOutputSize();
CRect clRect(0.0f, 0.0f, static_cast<float>(outputSize.Width),
static_cast<float>(outputSize.Height));
// Unlike Direct3D 9, D3D11 ClearRenderTargetView always clears full extent of the resource view.
/... | This setting seems should be cached as member variable and initialized only one time somewhere, maybe `InitRenderSystem()` | }
if (pRTView)
{
const auto outputSize = m_deviceResources->GetOutputSize();
CRect clRect(0.0f, 0.0f, static_cast<float>(outputSize.Width),
static_cast<float>(outputSize.Height));
// Unlike Direct3D 9, D3D11 ClearRenderTargetView always clears full extent of the resource view.
/... | @@ -345,46 +386,47 @@ bool CRenderSystemDX::ClearBuffers(KODI::UTILS::COLOR::Color color)
m_deviceResources->FinishCommandList();
// do not clear RT for anaglyph modes
- if ( m_stereoMode == RENDER_STEREO_MODE_ANAGLYPH_GREEN_MAGENTA
- || m_stereoMode == RENDER_STEREO_MODE_ANAGLYPH_RED_CYAN
-... | xbmc/rendering/dx/RenderSystemDX.cpp | 26 | C++ | 0.714 | performance | 122 | 51 | 51 | false | [Windows] D3D11 Implementation of Front to Back Rendering | 27,751 | xbmc/xbmc | 17,740 | C++ | thexai | CrystalP |
namespace
{
void GetFontsetsFromFile(const std::string& fontsetFilePath,
std::vector<StringSettingOption>& list,
const std::string& settingValue,
bool* currentValueSet)
{
CXBMCTinyXML xmlDoc;
if (xmlDoc.LoadFile(fontsetFilePath))
{
Ti... | Did this not cause a compiler error? I thought `g_localizeStrings` was removed in the last PR? | }
namespace
{
void GetFontsetsFromFile(const std::string& fontsetFilePath,
std::vector<StringSettingOption>& list,
const std::string& settingValue,
bool* currentValueSet)
{
CXBMCTinyXML xmlDoc;
if (xmlDoc.LoadFile(fontsetFilePath))
{
... | @@ -531,7 +532,7 @@ void GetFontsetsFromFile(const std::string& fontsetFilePath,
if (idAttr)
{
if (idLocAttr)
- list.emplace_back(g_localizeStrings.Get(atoi(idLocAttr)), idAttr); | xbmc/addons/Skin.cpp | 26 | C++ | 0.857 | question | 94 | 51 | 51 | false | [GUI] Fix some regressions regarding skin strings | 27,755 | xbmc/xbmc | 17,740 | C++ | garbear | enen92 |
if (focusedLayout && focusedLayout->MoveLeft())
return;
}
CGUIControl::OnLeft();
}
void CGUIBaseContainer::OnRight()
{
CGUIAction action = GetAction(ACTION_MOVE_RIGHT);
bool wrapAround = action.GetNavigation() == GetID() || !action.HasActionsMeetingCondition();
if (m_orientation == HORIZONTAL && Mo... | Please use ranges (and projection would also be possible here):
```suggestion
auto it = std::ranges::upper_bound(m_letterOffsets, offset, {}, &std::pair<int, std::string>::first);
```
Same for the other calls below. You don't need `<ranges>`, `<algorithm>` is enough | if (focusedLayout && focusedLayout->MoveLeft())
return;
}
CGUIControl::OnLeft();
}
void CGUIBaseContainer::OnRight()
{
CGUIAction action = GetAction(ACTION_MOVE_RIGHT);
bool wrapAround = action.GetNavigation() == GetID() || !action.HasActionsMeetingCondition();
if (m_orientation == HORIZONTAL && Mo... | @@ -630,30 +631,26 @@ void CGUIBaseContainer::OnRight()
void CGUIBaseContainer::OnNextLetter()
{
- int offset = CorrectOffset(GetOffset(), GetCursor());
- for (unsigned int i = 0; i < m_letterOffsets.size(); i++)
- {
- if (m_letterOffsets[i].first > offset)
- {
- SelectItem(m_letterOffsets[i].first);
... | xbmc/guilib/GUIBaseContainer.cpp | 26 | C++ | 1 | suggestion | 269 | 51 | 51 | false | [guilib] Use binary search for letter navigation in GUIBaseContainer | 27,766 | xbmc/xbmc | 17,740 | C++ | sundermann | pannal |
#pragma once
#include "RenderSystemTypes.h"
#include "threads/CriticalSection.h"
#include "utils/ColorUtils.h"
#include "utils/Geometry.h"
#include <memory>
#include <optional>
#include <string>
/*
* CRenderSystemBase interface allows us to create the rendering engine we use.
* We currently have two engines: ... | `ClearFunction` per the code guidelines https://github.com/xbmc/xbmc/blob/master/docs/CODE_GUIDELINES.md#83-enums |
#pragma once
#include "RenderSystemTypes.h"
#include "threads/CriticalSection.h"
#include "utils/ColorUtils.h"
#include "utils/Geometry.h"
#include <memory>
#include <optional>
#include <string>
/*
* CRenderSystemBase interface allows us to create the rendering engine we use.
* We currently have two engines: ... | @@ -28,6 +30,12 @@ enum class DEPTH_CULLING
FRONT_TO_BACK,
};
+enum class CLEAR_FUNCTION | xbmc/rendering/RenderSystem.h | 26 | C/C++ | 0.5 | suggestion | 113 | 51 | 51 | false | [Settings] Add Advanced Settings Reload Notification + Use in FileExtensionsProvider and Renderers | 27,772 | xbmc/xbmc | 17,740 | C++ | enen92 | CrystalP |
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "CharsetConverter.h"
#include <cassert>
namespace KODI
{
namespace PLATFORM
{
namespace WINDOWS
{
std::string FromW(const wchar_t* str, size_t length)
{
if (length == 0)
return std::string();
int resu... | @neo1973 if you have a chance, if I understood correctly this is legit since C++17?
It lets the Win API fill the string's buffer directly, avoiding a copy of the data later. | * SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "CharsetConverter.h"
#include <cassert>
#include <limits>
#include <Windows.h>
namespace KODI
{
namespace PLATFORM
{
namespace WINDOWS
{
std::string FromW(const wchar_t* str, size_t length)
{
std::string ne... | @@ -17,41 +18,53 @@ namespace WINDOWS
{
std::string FromW(const wchar_t* str, size_t length)
{
- int result = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, str, length, nullptr, 0, nullptr, nullptr);
- if (result == 0)
+ if (length == 0)
+ return std::string();
+
+ int result1 =
+ WideCharToMultiByt... | xbmc/platform/win32/CharsetConverter.cpp | 26 | C++ | 0.5 | suggestion | 173 | 51 | 51 | false | [Windows] FromW/ToW Improvements | 27,789 | xbmc/xbmc | 17,740 | C++ | CrystalP | CrystalP |
return InfoRet::INFO_ERROR;
if (fetchEpisodes)
{
InfoRet ret = RetrieveInfoForEpisodes(pItem, lResult, info2, useLocal, pDlgProgress);
if (ret == InfoRet::ADDED)
m_database.SetPathHash(pItem->GetPath(), pItem->GetProperty("hash").asString());
return ret;
}
... | The intent is to handle all cases in this way - just as it was when this code block was before the url parsing. | if (useLocal)
std::tie(result, loader) = ReadInfoTag(*pItem, info2, bDirNames, true);
if (result == InfoType::FULL && idTvShow < 0)
{
long lResult = AddVideo(pItem, info2, bDirNames, useLocal);
if (lResult < 0)
return InfoRet::INFO_ERROR;
if (fetchEpisodes)
{
... | @@ -893,6 +886,15 @@ CVideoInfoScanner::~CVideoInfoScanner()
scrUrl = loader->ScraperUrl();
pURL = &scrUrl;
}
+
+ // Process episodes added later after nfo is scanned in case there is an episode group and parsing url
+ if (idTvShow > -1 && (!isSeason || idSeason > -1) && (fetchEpisodes || !... | xbmc/video/VideoInfoScanner.cpp | 26 | C++ | 0.571 | suggestion | 111 | 51 | 51 | false | [Video][Library] Check for parsing nfos to ensure episode grouping respected when adding additional episodes. | 27,877 | xbmc/xbmc | 17,740 | C++ | 78andyp | 78andyp |
if (ret == InfoRet::ADDED)
m_database.SetPathHash(pItem->GetPath(), pItem->GetProperty("hash").asString());
return ret;
}
return InfoRet::ADDED;
}
if (result == InfoType::URL || result == InfoType::COMBINED)
{
scrUrl = loader->ScraperUrl();
pURL = &scrUrl;
... | This is not part of this commit. | {
long lResult = AddVideo(pItem, info2, bDirNames, useLocal);
if (lResult < 0)
return InfoRet::INFO_ERROR;
if (fetchEpisodes)
{
InfoRet ret = RetrieveInfoForEpisodes(pItem, lResult, files, info2, useLocal, pDlgProgress);
if (ret == InfoRet::ADDED)
m_databas... | @@ -893,6 +886,15 @@ CVideoInfoScanner::~CVideoInfoScanner()
scrUrl = loader->ScraperUrl();
pURL = &scrUrl;
}
+
+ // Process episodes added later after nfo is scanned in case there is an episode group and parsing url
+ if (idTvShow > -1 && (!isSeason || idSeason > -1) && (fetchEpisodes || !... | xbmc/video/VideoInfoScanner.cpp | 26 | C++ | 0.071 | suggestion | 32 | 51 | 51 | false | [Video][Library] Check for parsing nfos to ensure episode grouping respected when adding additional episodes. | 27,877 | xbmc/xbmc | 17,740 | C++ | 78andyp | 78andyp |
/*
* Copyright (C) 2026 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include <string>
#include <string_view>
#include <vector>
namespace KODI::UTILS::I18N
{
struct RegistryFileRecord;
/... | Guard these with an `#if FMT_VERSION < 100000` so they can't cause problems when including headers with older libfmt? | /*
* Copyright (C) 2026 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include <string>
#include <string_view>
#include <vector>
#include <fmt/format.h> //! \todo remove after upgrade to l... | @@ -12,6 +12,8 @@
#include <string_view>
#include <vector>
+#include <fmt/format.h> //! \todo remove after upgrade to libfmt >= 10.0 | xbmc/utils/i18n/Bcp47Registry/SubTagRegistryTypes.h | 15 | C/C++ | 0.714 | question | 117 | 40 | 40 | false | Fix build for libfmt < 10.0 | 27,927 | xbmc/xbmc | 17,740 | C++ | garbear | CrystalP |
/*
* Copyright (C) 2026 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include <string>
#include <string_view>
#include <vector>
namespace KODI::UTILS::I18N
{
struct RegistryFileRecord;
/... | one final thought :)
no need to remove the templates after libfmt upgrade, they're simply not instantiated when not used. therefor i'm of the opinion that even the FMT_VERSION check is not necessary..
But still happy with a merge as is. Let's go | struct VariantSubTag : BaseSubTag
{
std::vector<std::string> m_prefixes; //!< Recommended language prefixes
bool operator==(const VariantSubTag&) const = default;
bool Load(const RegistryFileRecord& fileRecord) override;
};
/*!
* \brief Grandfathered tag
*/
struct GrandfatheredTag : BaseSubTag
{
};
/*!
* \b... | @@ -135,3 +137,25 @@ struct RedundantTag : BaseSubTag
{
};
} // namespace KODI::UTILS::I18N
+
+#if FMT_VERSION < 100000
+// user-type formatters for libfmt < 10.0
+//! \todo remove after libfmt upgrade | xbmc/utils/i18n/Bcp47Registry/SubTagRegistryTypes.h | 26 | C/C++ | 0.571 | suggestion | 245 | 138 | 45 | false | Fix build for libfmt < 10.0 | 27,927 | xbmc/xbmc | 17,740 | C++ | howie-f | CrystalP |
bool CWinSystemAndroid::CreateNewWindow(const std::string& name,
bool fullScreen,
RESOLUTION_INFO& res)
{
m_nWidth = res.iWidth;
m_nHeight = res.iHeight;
m_displayWidth = res.iScreenWidth;
m_displayHeight = res.iScreenHeight;
m_fR... | ```suggestion
CLog::LogF(LOGDEBUG, "display modes update was pending, refreshing resolutions");
``` | bool CWinSystemAndroid::CreateNewWindow(const std::string& name,
bool fullScreen,
RESOLUTION_INFO& res)
{
m_nWidth = res.iWidth;
m_nHeight = res.iHeight;
m_displayWidth = res.iScreenWidth;
m_displayHeight = res.iScreenHeight;
m_fR... | @@ -127,6 +127,13 @@ bool CWinSystemAndroid::CreateNewWindow(const std::string& name,
return false;
}
+ if (m_dispModesUpdatePending)
+ {
+ CLog::Log(LOGDEBUG, "CWinSystemAndroid::CreateNewWindow: display modes update was pending, refreshing resolutions"); | xbmc/windowing/android/WinSystemAndroid.cpp | 26 | C++ | 1 | bug | 103 | 51 | 51 | false | [Android] Fix AFR not working after standby/wake cycle | 27,928 | xbmc/xbmc | 17,740 | C++ | thexai | fritsch |
else if (bLongClick[button])
m_Key = KEY_MOUSE_LONG_CLICK + button;
if (m_Key != KEY_MOUSE_NOOP)
break;
}
if (m_Key == KEY_MOUSE_NOOP)
{
// The bHold array is set to the drag action
if (bHold[MOUSE_LEFT_BUTTON] != 0)
{
switch (bHold[MOUSE_LEFT_BUTTON])
{
case ... | No issues found. | else if (bLongClick[button])
m_Key = KEY_MOUSE_LONG_CLICK + button;
if (m_Key != KEY_MOUSE_NOOP)
break;
}
if (m_Key == KEY_MOUSE_NOOP)
{
// The bHold array is set to the drag action
if (bHold[MOUSE_LEFT_BUTTON] != 0)
{
switch (bHold[MOUSE_LEFT_BUTTON])
{
case ... | @@ -75,6 +75,8 @@ void CMouseStat::HandleEvent(XBMC_Event& newEvent)
if (newEvent.button.button == XBMC_BUTTON_MIDDLE) m_mouseState.button[MOUSE_MIDDLE_BUTTON] = true;
if (newEvent.button.button == XBMC_BUTTON_X1) m_mouseState.button[MOUSE_EXTRA_BUTTON1] = true;
if (newEvent.button.button == XBMC_BUTTON_... | xbmc/input/MouseStat.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | mouse: Increase number of buttons supported from 5 to 7 | 6,579 | xbmc/xbmc | 17,740 | C++ | cjmayo | |
static CBaseRenderer* Create(CVideoBuffer *buffer);
static bool Register();
void Update() override;
bool RenderCapture(CRenderCapture* capture) override;
// Player functions
bool Configure(const VideoPicture &picture, float fps, unsigned int orientation) override;
void AddVideoPicture(const VideoPictur... | No issues found. |
static CBaseRenderer* Create(CVideoBuffer *buffer);
static bool Register();
void Update() override;
bool RenderCapture(CRenderCapture* capture) override;
// Player functions
bool Configure(const VideoPicture &picture, float fps, unsigned int orientation) override;
void AddVideoPicture(const VideoPictur... | @@ -125,5 +125,6 @@ class CWinRenderer : public CBaseRenderer
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_pCLUTView;
CD3DTexture m_IntermediateTarget;
+ CD3DTexture m_smoothTarget;
AVColorPrimaries m_srcPrimaries;
}; | xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | VideoPlayer: WinRenderer - add smooth motion | 14,278 | xbmc/xbmc | 17,740 | C++ | afedchin | |
}
}
if (albums.size() == 1 && !albumArt.empty())
{
// assign to folder thumb as well
CFileItem albumItem(path, true);
CMusicThumbLoader loader;
loader.SetCachedImage(albumItem, "thumb", albumArt);
}
}
void MUSIC_INFO::CMusicInfoScanner::RetrieveLocalArt()
{
if (m_handle)
{
m_handle-... | No issues found. | }
}
if (albums.size() == 1 && !albumArt.empty())
{
// assign to folder thumb as well
CFileItem albumItem(path, true);
CMusicThumbLoader loader;
loader.SetCachedImage(albumItem, "thumb", albumArt);
}
}
void MUSIC_INFO::CMusicInfoScanner::RetrieveLocalArt()
{
if (m_handle)
{
m_handle-... | @@ -35,6 +35,7 @@
#include "interfaces/AnnouncementManager.h"
#include "music/MusicLibraryQueue.h"
#include "music/MusicThumbLoader.h"
+#include "music/MusicUtils.h"
#include "music/tags/MusicInfoTag.h"
#include "music/tags/MusicInfoTagLoaderFactory.h"
#include "MusicAlbumInfo.h"
@@ -1908,31 +1909,12 @@ void CMus... | xbmc/music/infoscanner/MusicInfoScanner.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Include user config and available artwork in music "Choose art type" dialog | 15,805 | xbmc/xbmc | 17,740 | C++ | rmrector | |
std::string GetSetById(int id);
std::string GetTagById(int id);
std::string GetPersonById(int id);
std::string GetStudioById(int id);
std::string GetTvShowTitleById(int id);
std::string GetMusicVideoAlbumById(int id);
int GetTvShowForEpisode(int idEpisode);
int GetSeasonForEpisode(int idEpisode);
boo... | No issues found. | std::string GetSetById(int id);
std::string GetTagById(int id);
std::string GetPersonById(int id);
std::string GetStudioById(int id);
std::string GetTvShowTitleById(int id);
std::string GetMusicVideoAlbumById(int id);
int GetTvShowForEpisode(int idEpisode);
int GetSeasonForEpisode(int idEpisode);
boo... | @@ -848,6 +848,14 @@ class CVideoDatabase : public CDatabase
bool GetTvShowSeasonArt(int mediaId, std::map<int, std::map<std::string, std::string> > &seasonArt);
bool GetArtTypes(const MediaType &mediaType, std::vector<std::string> &artTypes);
+ /*! \brief Fetch the distinct types of available-but-unassigned a... | xbmc/video/VideoDatabase.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Add available artwork to the video 'Choose art type' dialog | 15,857 | xbmc/xbmc | 17,740 | C++ | rmrector | |
gameRes.iScreenHeight = sourceHeight;
m_renderContext.UpdateDisplayHardwareScaling(gameRes);
m_bDisplayScaleSet = true;
}
}
RenderInternal(renderer, renderBuffer, bClear, 255);
m_renderContext.SetRenderingResolution(coordsRes, false);
}
void CRPRenderManager::RenderControl(bool bClear,
... | No issues found. | gameRes.iScreenHeight = sourceHeight;
m_renderContext.UpdateDisplayHardwareScaling(gameRes);
m_bDisplayScaleSet = true;
}
}
RenderInternal(renderer, renderBuffer, bClear, 255);
m_renderContext.SetRenderingResolution(coordsRes, false);
}
void CRPRenderManager::RenderControl(bool bClear,
... | @@ -284,13 +284,49 @@ void CRPRenderManager::Flush()
void CRPRenderManager::RenderWindow(bool bClear, const RESOLUTION_INFO& coordsRes)
{
+ // Get a renderer for the fullscreen window
std::shared_ptr<CRPBaseRenderer> renderer = GetRenderer(nullptr);
if (!renderer)
return;
+ // Get a render buffer for... | xbmc/cores/RetroPlayer/rendering/RPRenderManager.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Integer Scaling support implementation to improve the viewing quality of Pixel Art games | 18,194 | xbmc/xbmc | 17,740 | C++ | slattann | |
m_overlay[3]->Release();
m_overlay[3] = new CDVDOverlayText();
m_overlay[3]->AddElement(new CDVDOverlayText::CElementText(m_strDebug[3]));
}
for (int i = 0; i < 4; i++)
m_overlayRenderer.AddOverlay(m_overlay[i], 0, 0);
}
void CDebugRenderer::SetInfo(DEBUG_INFO_VIDEO& video, DEBUG_INFO_RENDER& re... | No issues found. | m_overlay[3]->Release();
m_overlay[3] = new CDVDOverlayText();
m_overlay[3]->AddElement(new CDVDOverlayText::CElementText(m_strDebug[3]));
}
for (int i = 0; i < 4; i++)
m_overlayRenderer.AddOverlay(m_overlay[i], 0, 0);
}
void CDebugRenderer::SetInfo(DEBUG_INFO_VIDEO& video, DEBUG_INFO_RENDER& re... | @@ -17,7 +17,7 @@ using namespace OVERLAY;
CDebugRenderer::CDebugRenderer()
{
- for (int i=0; i<4; i++)
+ for (int i = 0; i < 6; i++)
{
m_overlay[i] = nullptr;
m_strDebug[i] = " ";
@@ -33,50 +33,105 @@ CDebugRenderer::~CDebugRenderer()
}
}
-void CDebugRenderer::SetInfo(std::string &info1, std::... | xbmc/cores/VideoPlayer/VideoRenderers/DebugRenderer.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Windows] Add video, HDR metadata, shader and swapchain infos to debug info OSD | 19,126 | xbmc/xbmc | 17,740 | C++ | thexai | |
{"genre", {"genre_link"}},
{"country", {"country_link"}},
{"tag", {"tag_link"}}
};
for (const auto& additionalTableEntry : additionalTablesMap)
{
std::string table = additionalTableEntry.first;
std::string tablePk = additionalTableEntry.first + "_id";
std::map<int, std::s... | No issues found. | {"genre", {"genre_link"}},
{"country", {"country_link"}},
{"tag", {"tag_link"}}
};
for (const auto& additionalTableEntry : additionalTablesMap)
{
std::string table = additionalTableEntry.first;
std::string tablePk = additionalTableEntry.first + "_id";
std::map<int, std::s... | @@ -62,6 +62,7 @@
#include <memory>
#include <string>
#include <vector>
+#include <unordered_set>
using namespace dbiplus;
using namespace XFILE;
@@ -4794,6 +4795,7 @@ std::vector<std::string> GetBasicItemAvailableArtTypes(int mediaId,
CVideoInfoTag tag = db.GetDetailsByTypeAndId(dbType, mediaId);
//! @t... | xbmc/video/VideoDatabase.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [jsonrpc] get available-but-not-assigned artwork | 19,185 | xbmc/xbmc | 17,740 | C++ | rmrector | |
#include "utils/StringUtils.h"
using namespace ADDON;
using namespace XFILE;
/*!
\brief Create a IDirectory object of the share type specified in a given item path.
\param item Specifies the item to which the factory will create the directory instance
\return IDirectory object to access the directories on the sha... | No issues found. | #include "utils/StringUtils.h"
using namespace ADDON;
using namespace XFILE;
/*!
\brief Create a IDirectory object of the share type specified in a given item path.
\param item Specifies the item to which the factory will create the directory instance
\return IDirectory object to access the directories on the sha... | @@ -46,7 +46,9 @@
#include "platform/posix/filesystem/SMBDirectory.h"
#endif
#endif
+#ifdef HAS_OPTICAL_DRIVE
#include "CDDADirectory.h"
+#endif // HAS_OPTICAL_DRIVE
#include "PluginDirectory.h"
#if defined(HAS_ISO9660PP)
#include "ISO9660Directory.h" | xbmc/filesystem/DirectoryFactory.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Make libcdio optional if not used | 19,197 | xbmc/xbmc | 17,740 | C++ | Karlson2k | |
using namespace RETRO;
CDialogInGameSaves::CDialogInGameSaves() : CDialogGameVideoSelect(WINDOW_DIALOG_IN_GAME_SAVES)
{
}
std::string CDialogInGameSaves::GetHeading()
{
return g_localizeStrings.Get(35249); // "Save / Load"
}
void CDialogInGameSaves::PreInit()
{
m_items.Clear();
InitSavedGames();
CFileItemP... | No issues found. | using namespace RETRO;
CDialogInGameSaves::CDialogInGameSaves() : CDialogGameVideoSelect(WINDOW_DIALOG_IN_GAME_SAVES)
{
}
std::string CDialogInGameSaves::GetHeading()
{
return g_localizeStrings.Get(35249); // "Save / Load"
}
void CDialogInGameSaves::PreInit()
{
m_items.Clear();
InitSavedGames();
CFileItemP... | @@ -31,7 +31,7 @@ CDialogInGameSaves::CDialogInGameSaves() : CDialogGameVideoSelect(WINDOW_DIALOG_
std::string CDialogInGameSaves::GetHeading()
{
- return g_localizeStrings.Get(35249); // "Saved games"
+ return g_localizeStrings.Get(35249); // "Save / Load"
}
void CDialogInGameSaves::PreInit()
@@ -40,11 +40,1... | xbmc/games/dialogs/osd/DialogInGameSaves.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Retroplayer: Savestate manager fixes | 22,490 | xbmc/xbmc | 17,740 | C++ | KOPRajs | |
#include <algorithm>
#include <stdio.h>
CDirtyRegionTracker::CDirtyRegionTracker()
{
m_solver = NULL;
}
CDirtyRegionTracker::~CDirtyRegionTracker()
{
delete m_solver;
}
void CDirtyRegionTracker::SelectAlgorithm()
{
delete m_solver;
switch (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_gui... | No issues found. | #include <algorithm>
#include <stdio.h>
CDirtyRegionTracker::CDirtyRegionTracker()
{
m_solver = NULL;
}
CDirtyRegionTracker::~CDirtyRegionTracker()
{
delete m_solver;
}
void CDirtyRegionTracker::SelectAlgorithm()
{
delete m_solver;
switch (CServiceBroker::GetSettingsComponent()->GetAdvancedSettings()->m_gui... | @@ -18,9 +18,8 @@
#include <algorithm>
#include <stdio.h>
-CDirtyRegionTracker::CDirtyRegionTracker(int buffering)
+CDirtyRegionTracker::CDirtyRegionTracker()
{
- m_buffering = buffering;
m_solver = NULL;
}
@@ -76,11 +75,10 @@ CDirtyRegionList CDirtyRegionTracker::GetDirtyRegions()
return output;
}
-v... | xbmc/guilib/DirtyRegionTracker.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Fix/improve dirty regions on GBM/Wayland/X11 (EGL) | 22,998 | xbmc/xbmc | 17,740 | C++ | sarbes | |
std::map<std::string, std::string> artwork = pItem->GetArt();
if (artwork.empty())
{
std::vector<std::string> artTypes = GetArtTypes(pItem->HasVideoInfoTag() ? pItem->GetVideoInfoTag()->m_type : "");
if (find(artTypes.begin(), artTypes.end(), "thumb") == artTypes.end())
artTypes.emplace_back("thumb"... | No issues found. | std::map<std::string, std::string> artwork = pItem->GetArt();
if (artwork.empty())
{
std::vector<std::string> artTypes = GetArtTypes(pItem->HasVideoInfoTag() ? pItem->GetVideoInfoTag()->m_type : "");
if (find(artTypes.begin(), artTypes.end(), "thumb") == artTypes.end())
artTypes.emplace_back("thumb"... | @@ -27,13 +27,11 @@
#include "settings/SettingUtils.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
-#include "utils/EmbeddedArt.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "utils/log.h"
#include "video/VideoDatabase.h"
#include "video/VideoInfoTag.h"
-#inclu... | xbmc/video/VideoThumbLoader.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [guilib][vfs][imagecache] Load special images into texture cache when viewed, like standard images | 23,197 | xbmc/xbmc | 17,740 | C++ | rmrector | |
/*
* Copyright (C) 2023 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "imagefiles/SpecialImageFileLoader.h"
/*!
* @brief Generates a thumbnail for a folder in the picture browser... | No issues found. | /*
* Copyright (C) 2023 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "imagefiles/SpecialImageFileLoader.h"
/*!
* @brief Generates a thumbnail for a folder in the picture browser... | @@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2023 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "imagefiles/SpecialImageFileLoader.h"
+
+/*!
+ * @brief Generates a thumbnail for ... | xbmc/pictures/PictureFolderImageFileLoader.h | 0 | C/C++ | 1 | none | 16 | 28 | 28 | true | [guilib][vfs][imagecache] Load picture folder images into texture cache when viewed, like standard images | 23,517 | xbmc/xbmc | 17,740 | C++ | rmrector | |
};
int id;
std::string file;
std::string hash;
unsigned int width;
unsigned int height;
bool updateable;
};
/*!
\ingroup textures
\brief Job class for caching textures
Handles loading and caching of textures.
*/
class CTextureCacheJob : public CJob
{
public:
CTextureCacheJob(con... | No issues found. | };
int id;
std::string file;
std::string hash;
unsigned int width;
unsigned int height;
bool updateable;
};
/*!
\ingroup textures
\brief Job class for caching textures
Handles loading and caching of textures.
*/
class CTextureCacheJob : public CJob
{
public:
CTextureCacheJob(con... | @@ -82,15 +82,6 @@ class CTextureCacheJob : public CJob
*/
static std::string GetImageHash(const std::string &url);
- /*! \brief Check whether a given URL represents an image that can be updated
- We currently don't check http:// and https:// URLs for updates, under the assumption that
- a image URL is mu... | xbmc/TextureCacheJob.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [imagecache] Don't check special generated images for file changes every 24 hours | 23,567 | xbmc/xbmc | 17,740 | C++ | rmrector | |
}
/*
* There is no further episode information available if both the season and episode number have
* been set to 0. Return the match as true so no further matching is attempted, but don't add it
* to the episode list.
*/
if (tag->m_iSeason == 0 && tag->m_iEpisode == 0)
{
CLog... | No issues found. | }
/*
* There is no further episode information available if both the season and episode number have
* been set to 0. Return the match as true so no further matching is attempted, but don't add it
* to the episode list.
*/
if (tag->m_iSeason == 0 && tag->m_iEpisode == 0)
{
CLog... | @@ -654,18 +654,48 @@ namespace VIDEO
movieTitle = tag->GetTitle();
movieYear = tag->GetYear(); // movieYear is expected to be >= 0
}
+
+ std::string identifierType;
+ std::string identifier;
+ long lResult = -1;
+ if (info2->IsPython() && CUtil::GetFilenameIdentifier(movieTitle, identifi... | xbmc/video/VideoInfoScanner.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Scraper] Support for filename identifiers | 23,840 | xbmc/xbmc | 17,740 | C++ | sundermann | |
if (CPicture::CacheTexture(texture.get(), width, height,
CTextureCache::GetCachedPath(m_details.file), scalingAlgorithm))
{
m_details.width = width;
m_details.height = height;
if (out_texture) // caller wants the texture
*out_texture = std::move(texture);... | No issues found. | if (CPicture::CacheTexture(texture.get(), width, height,
CTextureCache::GetCachedPath(m_details.file), scalingAlgorithm))
{
m_details.width = width;
m_details.height = height;
if (out_texture) // caller wants the texture
*out_texture = std::move(texture);... | @@ -118,7 +118,10 @@ bool CTextureCacheJob::CacheTexture(std::unique_ptr<CTexture>* out_texture)
return false;
if (m_details.hash == m_oldHash)
+ {
+ m_details.hashRevalidated = true;
return true;
+ }
}
std::unique_ptr<CTexture> texture = LoadImage(image, width, height, additiona... | xbmc/TextureCacheJob.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [imagecache] clarify logic around image revalidation, fixing some images returning 404 via HTTP | 23,956 | xbmc/xbmc | 17,740 | C++ | rmrector | |
success = CreateThumbnailFromSurface(reinterpret_cast<unsigned char*>(buffer.get()),
dest_width, dest_height, dest_width_aligned * 4, dest);
}
}
return success;
}
else
{ // no orientation needed
dest_width = width;
dest_height = height;
... | No issues found. | success = CreateThumbnailFromSurface(reinterpret_cast<unsigned char*>(buffer.get()),
dest_width, dest_height, dest_width_aligned * 4, dest);
}
}
return success;
}
else
{ // no orientation needed
dest_width = width;
dest_height = height;
... | @@ -333,70 +333,6 @@ std::unique_ptr<CTexture> CPicture::CreateTiledThumb(const std::vector<std::stri
return result;
}
-bool CPicture::CreateTiledThumb(const std::vector<std::string> &files, const std::string &thumb)
-{
- if (!files.size())
- return false;
-
- unsigned int num_across = (unsigned int)ceil(sqr... | xbmc/pictures/Picture.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [guilib][vfs][imagecache][pvr] Load PVR group images into texture cache when viewed, like standard images | 24,087 | xbmc/xbmc | 17,740 | C++ | rmrector | |
}
CBookmark CPVRRecording::GetResumePoint() const
{
const std::shared_ptr<const CPVRClient> client =
CServiceBroker::GetPVRManager().GetClient(m_iClientId);
if (client && client->GetClientCapabilities().SupportsRecordingsLastPlayedPosition() &&
m_resumePointRefetchTimeout.IsTimePast())
{
// @todo... | No issues found. | }
CBookmark CPVRRecording::GetResumePoint() const
{
const std::shared_ptr<const CPVRClient> client =
CServiceBroker::GetPVRManager().GetClient(m_iClientId);
if (client && client->GetClientCapabilities().SupportsRecordingsLastPlayedPosition() &&
m_resumePointRefetchTimeout.IsTimePast())
{
// @todo... | @@ -127,6 +127,14 @@ CPVRRecording::CPVRRecording(const PVR_RECORDING& recording, unsigned int iClien
CVideoInfoTag::SetResumePoint(recording.iLastPlayedPosition, recording.iDuration, "");
SetDuration(recording.iDuration);
+ m_parentalRating = recording.iParentalRating;
+ if (recording.strParentalRatingCode... | xbmc/pvr/recordings/PVRRecording.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [PVR][addons][guilib] Add support for PVR client add-ons supplying Parental Rating Icons, extend Rating support for Recordings | 24,096 | xbmc/xbmc | 17,740 | C++ | DeltaMikeCharlie | |
static const unsigned int READ_AUDIO_VIDEO = 0x40;
/* indicate that caller will do write operations before reading */
static const unsigned int READ_AFTER_WRITE = 0x80;
/* indicate that caller want to reopen a file if its already open */
static const unsigned int READ_REOPEN = 0x100;
struct SNativeIoControl
... | No issues found. | static const unsigned int READ_AUDIO_VIDEO = 0x40;
/* indicate that caller will do write operations before reading */
static const unsigned int READ_AFTER_WRITE = 0x80;
/* indicate that caller want to reopen a file if its already open */
static const unsigned int READ_REOPEN = 0x100;
struct SNativeIoControl
... | @@ -48,6 +48,7 @@ struct SNativeIoControl
struct SCacheStatus
{
+ uint64_t maxforward; /**< forward cache max capacity in bytes */
uint64_t forward; /**< number of bytes cached forward of current position */
uint32_t maxrate; /**< maximum allowed read(fill) rate (bytes/second) */
uint32_t currate; /**< av... | xbmc/filesystem/IFileTypes.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [VideoPlayer] Fix cache level calculation and add to Debug Info OSD | 24,117 | xbmc/xbmc | 17,740 | C++ | thexai | |
/*
* Copyright (C) 2024 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "ImageSettings.h"
using namespace KODI;
using namespace GUILIB;
namespace
{
constexpr auto IMAGE_FILTER_UNKNOWN = "unknown... | No issues found. | /*
* Copyright (C) 2024 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "ImageSettings.h"
using namespace KODI;
using namespace GUILIB;
namespace
{
constexpr auto IMAGE_FILTER_UNKNOWN = "unknown... | @@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2024 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "ImageSettings.h"
+
+using namespace KODI;
+using namespace GUILIB;
+
+namespace
+{
+constexpr aut... | xbmc/guilib/ImageSettings.cpp | 0 | C++ | 1 | none | 16 | 45 | 45 | true | guilib: Add nearest neighbor image scaling | 24,395 | xbmc/xbmc | 17,740 | C++ | garbear | |
if (numDevices <= 0)
{
CLog::Log(LOGERROR, "CDRMUtils::{} - no drm devices found: ({})", __FUNCTION__,
strerror(errno));
return false;
}
CLog::Log(LOGDEBUG, "CDRMUtils::{} - drm devices found: {}", __FUNCTION__, numDevices);
std::vector<drmDevicePtr> devices(numDevices);
int ret = d... | No issues found. | if (numDevices <= 0)
{
CLog::Log(LOGERROR, "CDRMUtils::{} - no drm devices found: ({})", __FUNCTION__,
strerror(errno));
return false;
}
CLog::Log(LOGDEBUG, "CDRMUtils::{} - drm devices found: {}", __FUNCTION__, numDevices);
std::vector<drmDevicePtr> devices(numDevices);
int ret = d... | @@ -181,77 +181,130 @@ bool CDRMUtils::FindPreferredMode()
return true;
}
-bool CDRMUtils::FindPlanes()
+bool CDRMUtils::FindGuiPlane()
{
- for (size_t i = 0; i < m_crtcs.size(); i++)
- {
- if (!(m_encoder->GetPossibleCrtcs() & (1 << i)))
+ /* find the gui plane which support ARGB and 8bit or 10 bit XRGB
+... | xbmc/windowing/gbm/drm/DRMUtils.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Dynamic Selection of DRM planes with GBM | 24,431 | xbmc/xbmc | 17,740 | C++ | hbiyik | |
m_pDS2->exec(PrepareSQL("UPDATE videoversiontype SET itemType = %i WHERE id = %i",
VideoAssetType::EXTRA, idType));
}
else
{
// system type used for an extra. copy as extras item type.
m_pDS2->query(
PrepareSQL("SELECT itemType, name ... | No issues found. | m_pDS2->exec(PrepareSQL("UPDATE videoversiontype SET itemType = %i WHERE id = %i",
VideoAssetType::EXTRA, idType));
}
else
{
// system type used for an extra. copy as extras item type.
m_pDS2->query(
PrepareSQL("SELECT itemType, name ... | @@ -1743,7 +1743,9 @@ int CVideoDatabase::AddUniqueIDs(int mediaId, const char *mediaType, const CVide
return uniqueid;
}
-int CVideoDatabase::AddSet(const std::string& strSet, const std::string& strOverview /* = "" */)
+int CVideoDatabase::AddSet(const std::string& strSet,
+ const std::... | xbmc/video/VideoDatabase.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [VideoDatabase] Do not overwrite Set Overview if no field in NFO | 24,533 | xbmc/xbmc | 17,740 | C++ | 78andyp | |
m_processInfo.SetVideoDeintMethod("hardware");
m_processInfo.SetVideoDAR(m_hints.aspect);
m_videoBufferPool = std::shared_ptr<CMediaCodecVideoBufferPool>(new CMediaCodecVideoBufferPool(m_codec));
UpdateFpsDuration();
return true;
FAIL:
m_InstanceGuard.exchange(false);
if (m_crypto)
{
delete m_cr... | No issues found. | m_processInfo.SetVideoDeintMethod("hardware");
m_processInfo.SetVideoDAR(m_hints.aspect);
m_videoBufferPool = std::shared_ptr<CMediaCodecVideoBufferPool>(new CMediaCodecVideoBufferPool(m_codec));
UpdateFpsDuration();
return true;
FAIL:
m_InstanceGuard.exchange(false);
if (m_crypto)
{
delete m_cr... | @@ -23,8 +23,10 @@
#include "cores/VideoPlayer/VideoRenderers/RenderManager.h"
#include "media/decoderfilter/DecoderFilterManager.h"
#include "messaging/ApplicationMessenger.h"
+#include "settings/SettingUtils.h"
#include "settings/Settings.h"
#include "settings/SettingsComponent.h"
+#include "settings/lib/Setting... | xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Android] Add HDR allowed dynamic metadata formats setting | 24,584 | xbmc/xbmc | 17,740 | C++ | quietvoid | |
break;
}
default:
break;
}
}
else
{
return false;
}
AfterRenderHook(index);
return true;
}
void CLinuxRendererGLES::RenderSinglePass(int index, int field)
{
CPictureBuffer &buf = m_buffers[index];
CYuvPlane (&planes)[YuvImage::MAX_PLANES] = m_buffers[index].fields[field];
... | No issues found. | break;
}
default:
break;
}
}
else
{
return false;
}
AfterRenderHook(index);
return true;
}
void CLinuxRendererGLES::RenderSinglePass(int index, int field)
{
CPictureBuffer &buf = m_buffers[index];
CYuvPlane (&planes)[YuvImage::MAX_PLANES] = m_buffers[index].fields[field];
... | @@ -584,6 +584,8 @@ void CLinuxRendererGLES::UpdateVideoFilter()
}
m_scalingMethodGui = m_videoSettings.m_ScalingMethod;
+ if (m_scalingMethod != m_scalingMethodGui)
+ m_reloadShaders = true;
m_scalingMethod = m_scalingMethodGui;
m_viewRect = viewRect;
@@ -616,15 +618,15 @@ void CLinuxRendererGLES::... | xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | GLES: Implement fast HQ video scalers | 24,611 | xbmc/xbmc | 17,740 | C++ | sarbes | |
m_clientCapabilities.SupportsRecordingsSize());
}
PVR_ERROR CPVRClient::GetTimersAmount(int& iTimers) const
{
iTimers = -1;
return DoAddonCall(
__func__,
[&iTimers](const AddonInstance* addon)
{ return addon->toAddon->GetTimersAmount(addon, &iTimers); },
m_clientCapabilities.SupportsT... | No issues found. | m_clientCapabilities.SupportsRecordingsSize());
}
PVR_ERROR CPVRClient::GetTimersAmount(int& iTimers) const
{
iTimers = -1;
return DoAddonCall(
__func__,
[&iTimers](const AddonInstance* addon)
{ return addon->toAddon->GetTimersAmount(addon, &iTimers); },
m_clientCapabilities.SupportsT... | @@ -1554,11 +1554,12 @@ PVR_ERROR CPVRClient::GetDescrambleInfo(int channelUid, CPVRDescrambleInfo& desc
}
PVR_ERROR CPVRClient::GetChannelStreamProperties(const std::shared_ptr<const CPVRChannel>& channel,
+ PVR_SOURCE source,
... | xbmc/pvr/addons/PVRClient.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [pvr] Improve support for live streaming from Epg Tags for Archive/Catchup | 24,622 | xbmc/xbmc | 17,740 | C++ | phunkyfish | |
/*
* Copyright (C) 2024 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "HDRStatus.h"
class CWinRtUtil
{
private:
CWinRtUtil() = default;
~CWinRtUtil() = default;
public:
sta... | No issues found. | /*
* Copyright (C) 2024 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#pragma once
#include "HDRStatus.h"
class CWinRtUtil
{
private:
CWinRtUtil() = default;
~CWinRtUtil() = default;
public:
sta... | @@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2024 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include "HDRStatus.h"
+
+class CWinRtUtil
+{
+private:
+ CWinRtUtil() = default;
+ ~CWin... | xbmc/platform/win32/WinRtUtil.h | 0 | C/C++ | 1 | none | 16 | 23 | 23 | true | [windows] Identify SDR WCG screens as non HDR-capable | 24,689 | xbmc/xbmc | 17,740 | C++ | CrystalP | |
return true;
m_savePath = "";
if (VIDEO::IsBlurayPlaylist(item) && forceSelection)
{
m_savePath = item.GetDynPath(); // save for screen refresh later
item.SetDynPath(item.GetBlurayPath());
}
if (VIDEO::IsBDFile(item))
{
std::string root = URIUtils::GetParentPath(item.GetDynPath());
URI... | No issues found. | return true;
m_savePath = "";
if (VIDEO::IsBlurayPlaylist(item) && forceSelection)
{
m_savePath = item.GetDynPath(); // save for screen refresh later
item.SetDynPath(item.GetBlurayPath());
}
if (VIDEO::IsBDFile(item))
{
std::string root = URIUtils::GetParentPath(item.GetDynPath());
URI... | @@ -29,6 +29,8 @@
#include "video/VideoFileItemClassify.h"
#include "video/VideoInfoTag.h"
+std::string m_savePath;
+
using namespace KODI;
namespace
@@ -52,12 +54,18 @@ class CGetDirectoryItems : public IRunnable
};
}
-
-bool CGUIDialogSimpleMenu::ShowPlaySelection(CFileItem& item)
+bool CGUIDialogSimpleMe... | xbmc/dialogs/GUIDialogSimpleMenu.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Video] Improve user experience when playing movies/episodes from Bluray ISO/BDMV. | 24,720 | xbmc/xbmc | 17,740 | C++ | 78andyp | |
std::vector<RefreshVideoLatency> m_videoRefreshLatency;
float m_videoDefaultLatency;
float m_videoDefaultHdrExtraLatency;
int m_videoCaptureUseOcclusionQuery;
bool m_DXVACheckCompatibility;
bool m_DXVACheckCompatibilityPresent;
int m_videoFpsDetect;
float m_maxTempo;
bool m_videoPr... | No issues found. | std::vector<RefreshVideoLatency> m_videoRefreshLatency;
float m_videoDefaultLatency;
float m_videoDefaultHdrExtraLatency;
int m_videoCaptureUseOcclusionQuery;
bool m_DXVACheckCompatibility;
bool m_DXVACheckCompatibilityPresent;
int m_videoFpsDetect;
float m_maxTempo;
bool m_videoPr... | @@ -94,6 +94,7 @@ struct RefreshVideoLatency
float refreshmax;
float delay;
+ float hdrextradelay;
};
typedef std::vector<TVShowRegexp> SETTINGS_TVSHOWLIST;
@@ -163,6 +164,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler
std::vector<RefreshOverride> m_videoAdjustRefreshO... | xbmc/settings/AdvancedSettings.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [AdvandedSettings] Additional latency setting for HDR | 24,917 | xbmc/xbmc | 17,740 | C++ | XR0M4N | |
if (scraper->IsPython() && CUtil::HasFilenameIdentifier(itemTitle))
{
CFileItemList items;
items.Add(m_item);
items.SetPath(m_item->m_bIsFolder ? URIUtils::GetParentPath(m_item->GetPath())
: URIUtils::GetDirectory(m_item->GetPath()));
... | No issues found. | if (scraper->IsPython() && CUtil::HasFilenameIdentifier(itemTitle))
{
CFileItemList items;
items.Add(m_item);
items.SetPath(m_item->m_bIsFolder ? URIUtils::GetParentPath(m_item->GetPath())
: URIUtils::GetDirectory(m_item->GetPath()));
... | @@ -24,6 +24,8 @@
#include "guilib/LocalizeStrings.h"
#include "media/MediaType.h"
#include "messaging/helpers/DialogOKHelper.h"
+#include "settings/AdvancedSettings.h"
+#include "settings/SettingsComponent.h"
#include "utils/StringUtils.h"
#include "utils/URIUtils.h"
#include "utils/log.h"
@@ -118,6 +120,14 @@ b... | xbmc/video/jobs/VideoLibraryRefreshingJob.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [VideoInfoScanner] Honor importwatchedstate and importresumepoint from AS.xml | 24,925 | xbmc/xbmc | 17,740 | C++ | neo1973 | |
return true;
}
case ACTION_DIALOG_SELECT_VIDEO:
{
VIDEO::GUILIB::OpenDialogSelectVideoStream();
return true;
}
case ACTION_ZOOM_IN:
{
CVideoSettings vs = appPlayer->GetVideoSettings();
vs.m_CustomZoomAmount += 0.01f;
if (vs.m_CustomZo... | No issues found. | return true;
}
case ACTION_DIALOG_SELECT_VIDEO:
{
VIDEO::GUILIB::OpenDialogSelectVideoStream();
return true;
}
case ACTION_ZOOM_IN:
{
CVideoSettings vs = appPlayer->GetVideoSettings();
vs.m_CustomZoomAmount += 0.01f;
if (vs.m_CustomZo... | @@ -97,6 +97,7 @@ bool CPlayerController::OnAction(const CAction &action)
}
case ACTION_NEXT_SUBTITLE:
+ case ACTION_PREV_SUBTITLE:
case ACTION_CYCLE_SUBTITLE:
{
if (appPlayer->GetSubtitleCount() == 0)
@@ -107,19 +108,25 @@ bool CPlayerController::OnAction(const CAction &acti... | xbmc/video/PlayerController.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Video][Actions] new action: PreviousSubtitle | 24,943 | xbmc/xbmc | 17,740 | C++ | foresto | |
hasMatrix = true;
av_channel_layout_uninit(&dstChLayout);
}
av_channel_layout_from_mask(&dstChLayout, m_dst_chan_layout);
av_channel_layout_from_mask(&srcChLayout, m_src_chan_layout);
int ret = swr_alloc_set_opts2(&m_pContext, &dstChLayout, m_dst_fmt, m_dst_rate, &srcChLayout,
... | No issues found. |
hasMatrix = true;
av_channel_layout_uninit(&dstChLayout);
}
av_channel_layout_from_mask(&dstChLayout, m_dst_chan_layout);
av_channel_layout_from_mask(&srcChLayout, m_src_chan_layout);
int ret = swr_alloc_set_opts2(&m_pContext, &dstChLayout, m_dst_fmt, m_dst_rate, &srcChLayout,
... | @@ -73,54 +73,7 @@ bool CActiveAEResampleFFMPEG::Init(SampleConfig dstConfig,
AVChannelLayout dstChLayout = {};
AVChannelLayout srcChLayout = {};
- av_channel_layout_from_mask(&dstChLayout, m_dst_chan_layout);
- av_channel_layout_from_mask(&srcChLayout, m_src_chan_layout);
-
- int ret = swr_alloc_set_opts2(&... | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResampleFFMPEG.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Update to ffmpeg 7.1 | 24,972 | xbmc/xbmc | 17,740 | C++ | sundermann | |
uint32_t frames;
CAESinkXAudio* sink;
~buffer_ctx()
{
delete[] data;
sink->m_framesInBuffers -= frames;
sink = nullptr;
}
};
struct VoiceCallback : public IXAudio2VoiceCallback
{
VoiceCallback()
{
mBufferEnd.reset(CreateEventEx(null... | No issues found. | uint32_t frames;
CAESinkXAudio* sink;
~buffer_ctx()
{
delete[] data;
sink->m_framesInBuffers -= frames;
sink = nullptr;
}
};
struct VoiceCallback : public IXAudio2VoiceCallback
{
VoiceCallback()
{
mBufferEnd.reset(CreateEventEx(null... | @@ -111,8 +111,8 @@ class CAESinkXAudio : public IAESink
HANDLE m_StreamEndEvent{0};
};
- bool InitializeInternal(std::string deviceId, AEAudioFormat &format);
- bool IsUSBDevice();
+ bool InitializeInternal(std::string deviceId, AEAudioFormat& format);
+
/*!
* \brief Add a 1 frame lon... | xbmc/cores/AudioEngine/Sinks/AESinkXAudio.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [Windows] enable XAudio2 sink in Windows desktop and code improvements | 25,068 | xbmc/xbmc | 17,740 | C++ | thexai | |
- (void)windowDidBecomeKey:(NSNotification*)aNotification
{
g_application.m_AppFocused = true;
CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::GUI, "WindowFocused");
auto winSystem = dynamic_cast<CWinSystemOSX*>(CServiceBroker::GetWinSystem());
if (winSystem)
{
winSystem->enableInputEve... | No issues found. |
- (void)windowDidBecomeKey:(NSNotification*)aNotification
{
g_application.m_AppFocused = true;
CServiceBroker::GetAnnouncementManager()->Announce(ANNOUNCEMENT::GUI, "WindowFocused");
auto winSystem = dynamic_cast<CWinSystemOSX*>(CServiceBroker::GetWinSystem());
if (winSystem)
{
winSystem->enableInputEve... | @@ -22,8 +22,6 @@
@implementation XBMCWindowControllerMacOS
-bool m_inFullscreenTransition = false;
-
- (nullable instancetype)initWithTitle:(NSString*)title defaultSize:(NSSize)size
{
auto frame = NSMakeRect(0, 0, size.width, size.height);
@@ -81,9 +79,6 @@ - (void)windowDidResize:(NSNotification*)aNotificat... | xbmc/windowing/osx/OpenGL/WindowControllerMacOS.mm | 0 | Objective-C++ | 1 | none | 16 | 51 | 51 | true | Rendering: Set window dirty only on app thread | 25,121 | xbmc/xbmc | 17,740 | C++ | enen92 | |
}
if (fileitem.GetProperty(STREAM_PROPERTY_INPUTSTREAM).asString() ==
STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG)
return std::make_shared<CDVDInputStreamFFmpeg>(fileitem);
if (fileitem.IsDiscImage())
{
#ifdef HAVE_LIBBLURAY
CURL url("udf://");
url.SetHostName(file);
url.SetFileName("BDMV/in... | No issues found. | }
if (fileitem.GetProperty(STREAM_PROPERTY_INPUTSTREAM).asString() ==
STREAM_PROPERTY_VALUE_INPUTSTREAMFFMPEG)
return std::make_shared<CDVDInputStreamFFmpeg>(fileitem);
if (fileitem.IsDiscImage())
{
#ifdef HAVE_LIBBLURAY
CURL url("udf://");
url.SetHostName(file);
url.SetFileName("BDMV/in... | @@ -182,8 +182,8 @@ std::shared_ptr<CDVDInputStream> CDVDFactoryInputStream::CreateInputStream(IVide
}
// our file interface handles all these types of streams
- return std::make_shared<CDVDInputStreamFile>(
- finalFileitem, XFILE::READ_TRUNCATED | XFILE::READ_BITRATE | XFILE::READ_CHUNKED);
+ return std... | xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [FileSystem] deprecate use of READ_CHUNKED flag | 25,158 | xbmc/xbmc | 17,740 | C++ | thexai | |
#include <gtest/gtest.h>
using namespace KODI;
struct PlayListClassifyTest
{
PlayListClassifyTest(const std::string& path, bool res, const std::string& mime = "")
: item(path, false), result(res)
{
if (!mime.empty())
item.SetMimeType(mime);
}
CFileItem item;
bool result;
};
class PlayListTe... | No issues found. |
#include <gtest/gtest.h>
using namespace KODI;
struct PlayListClassifyTest
{
PlayListClassifyTest(const std::string& path, bool res, const std::string& mime = "")
: item(path, false), result(res)
{
if (!mime.empty())
item.SetMimeType(mime);
}
CFileItem item;
bool result;
};
class PlayListTe... | @@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "FileItem.h"
+#include "playlists/PlayListFileItemClassify.h"
+#include "utils/Variant.h"
+
+... | xbmc/playlists/test/TestPlayListFileItemClassify.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Add playlist FileItem classify | 25,200 | xbmc/xbmc | 17,740 | C++ | notspiff | |
double delay = m_audioSink.GetDelay();
if (pts > m_audioClock - delay + 0.5 * DVD_TIME_BASE)
{
m_audioSink.Flush();
}
m_audioClock = pts + delay;
if (m_speed != DVD_PLAYSPEED_PAUSE)
m_audioSink.Resume();
m_syncState = IDVDStreamPlayer::SYNC_INSYNC;
m_syncT... | No issues found. | double delay = m_audioSink.GetDelay();
if (pts > m_audioClock - delay + 0.5 * DVD_TIME_BASE)
{
m_audioSink.Flush();
}
m_audioClock = pts + delay;
if (m_speed != DVD_PLAYSPEED_PAUSE)
m_audioSink.Resume();
m_syncState = IDVDStreamPlayer::SYNC_INSYNC;
m_syncT... | @@ -43,12 +43,16 @@ class CDVDMsgAudioCodecChange : public CDVDMsg
CDVDStreamInfo m_hints;
};
-
-CVideoPlayerAudio::CVideoPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent, CProcessInfo &processInfo)
-: CThread("VideoPlayerAudio"), IDVDStreamPlayerAudio(processInfo)
-, m_messageQueue("audio")
-, m_messageP... | xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [VideoPlayer] define message queue time size in a single place | 25,334 | xbmc/xbmc | 17,740 | C++ | thexai | |
if (m_crypto)
{
delete m_crypto;
m_crypto = nullptr;
}
m_decryptCodec = nullptr;
}
bool CDVDAudioCodecAndroidMediaCodec::AddData(const DemuxPacket &packet)
{
CLog::Log(LOGDEBUG, LOGAUDIO,
"CDVDAudioCodecAndroidMediaCodec::AddData dts:{:0.4f} pts:{:0.4f} size({})", packet.dts,
... | No issues found. | if (m_crypto)
{
delete m_crypto;
m_crypto = nullptr;
}
m_decryptCodec = nullptr;
}
bool CDVDAudioCodecAndroidMediaCodec::AddData(const DemuxPacket &packet)
{
CLog::Log(LOGDEBUG, LOGAUDIO,
"CDVDAudioCodecAndroidMediaCodec::AddData dts:{:0.4f} pts:{:0.4f} size({})", packet.dts,
... | @@ -27,6 +27,7 @@
#include "utils/log.h"
#include <cassert>
+#include <memory>
#include <stdexcept>
#include <androidjni/ByteBuffer.h>
@@ -208,7 +209,7 @@ bool CDVDAudioCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio
mimeTypes = codec_info.getSupportedTypes();
if (std::find(mime... | xbmc/cores/VideoPlayer/DVDCodecs/Audio/DVDAudioCodecAndroidMediaCodec.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [clang-tidy] fix modernize-* and performance-* warnings | 25,343 | xbmc/xbmc | 17,740 | C++ | Rechi | |
EXPECT_GT(edl.GetRawEditList().size(), 0);
EXPECT_EQ(edl.HasCuts(), true);
EXPECT_EQ(edl.HasSceneMarker(), true);
EXPECT_EQ(edl.GetSceneMarkers().size(), 4);
EXPECT_EQ(edl.GetCutMarkers().size(), 3);
// in videoredo time processing is ms * 10000
// first cut in the file is at 4235230000 - let's confirm th... | No issues found. | EXPECT_GT(edl.GetRawEditList().size(), 0);
EXPECT_EQ(edl.HasCuts(), true);
EXPECT_EQ(edl.HasSceneMarker(), true);
EXPECT_EQ(edl.GetSceneMarkers().size(), 4);
EXPECT_EQ(edl.GetCutMarkers().size(), 3);
// in videoredo time processing is ms * 10000
// first cut in the file is at 4235230000 - let's confirm th... | @@ -84,17 +84,20 @@ TEST_F(TestEdl, TestParsingMplayerTimeBasedEDL)
const auto commbreak = edl.GetEditList().at(1);
EXPECT_EQ(commbreak.action, Action::COMM_BREAK);
// We should have a scenemarker at the commbreak start and another on commbreak end
- int time;
+ std::optional<int> time = edl.GetNextSceneMark... | xbmc/cores/VideoPlayer/test/edl/TestEdl.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [EDL][Players] Cleanup FIXMEs | 25,346 | xbmc/xbmc | 17,740 | C++ | enen92 | |
/*
* Copyright (C) 2024 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "PlayerSettings.h"
#include "guilib/LocalizeStrings.h"
#include "utils/StringUtils.h"
void CPlayerSettings::SettingOptions... | No issues found. | /*
* Copyright (C) 2024 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/
#include "PlayerSettings.h"
#include "guilib/LocalizeStrings.h"
#include "utils/StringUtils.h"
void CPlayerSettings::SettingOptions... | @@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "PlayerSettings.h"
+
+#include "guilib/LocalizeStrings.h"
+#include "utils/StringUtils.h"
+
+void ... | xbmc/settings/PlayerSettings.cpp | 0 | C++ | 1 | none | 16 | 47 | 47 | true | [VideoPlayer] Add GUI settings for audio/video playback queues | 25,360 | xbmc/xbmc | 17,740 | C++ | thexai | |
protected:
TestMetadataExtraction() = default;
};
TEST_F(TestMetadataExtraction, TestGPSImage)
{
auto path = XBMC_REF_FILE_PATH("xbmc/pictures/metadata/test/testdata/exifgps.jpg");
std::unique_ptr<ImageMetadata> metadata = CImageMetadataParser::ExtractMetadata(path);
// Extract GPS tags
EXPECT_EQ(metadata->e... | No issues found. | protected:
TestMetadataExtraction() = default;
};
TEST_F(TestMetadataExtraction, TestGPSImage)
{
auto path = XBMC_REF_FILE_PATH("xbmc/pictures/metadata/test/testdata/exifgps.jpg");
std::unique_ptr<ImageMetadata> metadata = CImageMetadataParser::ExtractMetadata(path);
// Extract GPS tags
EXPECT_EQ(metadata->e... | @@ -46,9 +46,11 @@ TEST_F(TestMetadataExtraction, TestGPSImage)
EXPECT_EQ(metadata->width, 1);
EXPECT_EQ(metadata->height, 1);
EXPECT_TRUE(metadata->fileComment.empty());
+#if (EXIV2_MAJOR_VERSION >= 0) && (EXIV2_MINOR_VERSION >= 28) && (EXIV2_PATCH_VERSION >= 2)
// format specific (but common) metadata
... | xbmc/pictures/metadata/test/TestMetadataExtraction.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Exiv2 support old API | 25,363 | xbmc/xbmc | 17,740 | C++ | fuzzard | |
#pragma once
#include <deque>
#include <stdint.h>
#include <vector>
enum class Type
{
PADDING,
DATA,
};
class CPackerMAT
{
public:
CPackerMAT();
~CPackerMAT() = default;
bool PackTrueHD(const uint8_t* data, int size);
std::vector<uint8_t> GetOutputFrame();
private:
struct MATState
{
bool init; ... | No issues found. | #pragma once
#include <deque>
#include <stdint.h>
#include <vector>
enum class Type
{
PADDING,
DATA,
};
class CPackerMAT
{
public:
CPackerMAT();
~CPackerMAT() = default;
bool PackTrueHD(const uint8_t* data, int size);
std::vector<uint8_t> GetOutputFrame();
private:
struct MATState
{
bool init; ... | @@ -12,14 +12,6 @@
#include <stdint.h>
#include <vector>
-struct TrueHDMajorSyncInfo
-{
- int ratebits{0};
- uint16_t outputTiming{0};
- bool outputTimingPresent{false};
- bool valid{false};
-};
-
enum class Type
{
PADDING,
@@ -49,22 +41,14 @@ class CPackerMAT
// 10 -> 176.4 kHz
int ratebits;
-... | xbmc/cores/AudioEngine/Utils/PackerMAT.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [Audio] PackerMAT: simplify code - remove non-essential code | 25,367 | xbmc/xbmc | 17,740 | C++ | thexai | |
* provided with respect to the original media item timeline.
*/
const std::vector<EDL::Edit>& GetRawEditList() const { return m_vecEdits; }
/*!
* @brief Get the EDL edit list.
* @return The EDL edits or an empty vector if no edits exist. Edits are
* provided with respect to the actual timeline, i.e. ... | No issues found. | * provided with respect to the original media item timeline.
*/
const std::vector<EDL::Edit>& GetRawEditList() const { return m_vecEdits; }
/*!
* @brief Get the EDL edit list.
* @return The EDL edits or an empty vector if no edits exist. Edits are
* provided with respect to the actual timeline, i.e. ... | @@ -45,7 +45,7 @@ class CEdl
* because of EDL cuts
* @return the total cut time
*/
- int GetTotalCutTime() const;
+ std::chrono::milliseconds GetTotalCutTime() const;
/*!
* @brief Providing a given seek time, return the actual time without
@@ -55,7 +55,7 @@ class CEdl
* @param seek the desired... | xbmc/cores/VideoPlayer/Edl.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [EDL] Use std::chrono | 25,368 | xbmc/xbmc | 17,740 | C++ | enen92 | |
#include "FileItem.h"
#include "filesystem/File.h"
#include "filesystem/StackDirectory.h"
#include "utils/URIUtils.h"
using namespace XFILE;
namespace KODI::ART
{
// Gets the .tbn filename from a file or folder name.
// <filename>.ext -> <filename>.tbn
// <foldername>/ -> <foldername>.tbn
std::string GetTBNFile(cons... | No issues found. | #include "FileItem.h"
#include "filesystem/File.h"
#include "filesystem/StackDirectory.h"
#include "utils/URIUtils.h"
using namespace XFILE;
namespace KODI::ART
{
// Gets the .tbn filename from a file or folder name.
// <filename>.ext -> <filename>.tbn
// <foldername>/ -> <foldername>.tbn
std::string GetTBNFile(cons... | @@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2024 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "ArtUtils.h"
+
+#include "FileItem.h"
+#include "filesystem/File.h"
+#include "filesystem/StackDir... | xbmc/utils/ArtUtils.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | changed: move CFileItem::GetTBNFile to ArtUtils | 25,387 | xbmc/xbmc | 17,740 | C++ | notspiff | |
}
double CActiveAEStream::GetMaxDelay()
{
return static_cast<double>(m_activeAE->GetMaxDelay());
}
void CActiveAEStream::Pause()
{
m_activeAE->PauseStream(this, true);
}
void CActiveAEStream::Resume()
{
m_activeAE->PauseStream(this, false);
}
void CActiveAEStream::Drain(bool wait)
{
Message *msg;
CActiveA... | No issues found. | }
double CActiveAEStream::GetMaxDelay()
{
return static_cast<double>(m_activeAE->GetMaxDelay());
}
void CActiveAEStream::Pause()
{
m_activeAE->PauseStream(this, true);
}
void CActiveAEStream::Resume()
{
m_activeAE->PauseStream(this, false);
}
void CActiveAEStream::Drain(bool wait)
{
Message *msg;
CActiveA... | @@ -143,13 +143,9 @@ void CActiveAEStream::InitRemapper()
srcConfig.bits_per_sample = CAEUtil::DataFormatToUsedBits(m_format.m_dataFormat);
srcConfig.dither_bits = CAEUtil::DataFormatToDitherBits(m_format.m_dataFormat);
- m_remapper->Init(dstConfig, srcConfig,
- false,
- ... | xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | AudioEngine: Include LFE mixing setting | 25,395 | xbmc/xbmc | 17,740 | C++ | fritsch | |
{
std::string path = URIUtils::GetDirectory(file);
std::string parent;
URIUtils::GetParentPath(path, parent);
file = URIUtils::AddFileToFolder(parent, URIUtils::GetFileName(item.GetPath()));
}
// no local fanart available for these
if (NETWORK::IsInternetStream(item) || URIUtils::IsUPnP(file) |... | No issues found. | {
std::string path = URIUtils::GetDirectory(file);
std::string parent;
URIUtils::GetParentPath(path, parent);
file = URIUtils::AddFileToFolder(parent, URIUtils::GetFileName(item.GetPath()));
}
// no local fanart available for these
if (NETWORK::IsInternetStream(item) || URIUtils::IsUPnP(file) |... | @@ -9,15 +9,111 @@
#include "ArtUtils.h"
#include "FileItem.h"
+#include "FileItemList.h"
+#include "ServiceBroker.h"
+#include "filesystem/Directory.h"
#include "filesystem/File.h"
#include "filesystem/StackDirectory.h"
+#include "network/NetworkFileItemClassify.h"
+#include "settings/AdvancedSettings.h"
+#inclu... | xbmc/utils/ArtUtils.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | move CFileItem::GetLocalFanart to ArtUtils | 25,416 | xbmc/xbmc | 17,740 | C++ | notspiff | |
/*!
* \brief Set the subtitle alignment
* \param align The alignment
*/
void SetAlignment(Align align);
/*!
* \brief Get horizontal text alignment
* \return The alignment
*/
HorizontalAlign GetHorizontalAlignment();
/*!
* \brief Get font name
* \return The font name
*/
std::stri... | No issues found. | /*!
* \brief Set the subtitle alignment
* \param align The alignment
*/
void SetAlignment(Align align);
/*!
* \brief Get horizontal text alignment
* \return The alignment
*/
HorizontalAlign GetHorizontalAlignment();
/*!
* \brief Get font name
* \return The font name
*/
std::stri... | @@ -160,6 +160,12 @@ class CSubtitlesSettings : public ISettingCallback, public Observable
*/
int GetBlurSize();
+ /*!
+ * \brief Get line spacing
+ * \return The line spacing
+ */
+ int GetLineSpacing();
+
/*!
* \brief Get background type
* \return The background type | xbmc/settings/SubtitlesSettings.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Add a setting to make subtitles line spacing configurable | 25,421 | xbmc/xbmc | 17,740 | C++ | stigger | |
else
m_playback_state &= ~PLAYBACK_STATE_VIDEO;
if (appPlayer->HasAudio())
m_playback_state |= PLAYBACK_STATE_AUDIO;
else
m_playback_state &= ~PLAYBACK_STATE_AUDIO;
pos = appPlayer->GetTime();
speed = appPlayer->GetPlaySpeed();
if (m_playback_state & PLAYBACK_STATE_PLAYING)
... | No issues found. | else
m_playback_state &= ~PLAYBACK_STATE_VIDEO;
if (appPlayer->HasAudio())
m_playback_state |= PLAYBACK_STATE_AUDIO;
else
m_playback_state &= ~PLAYBACK_STATE_AUDIO;
pos = appPlayer->GetTime();
speed = appPlayer->GetPlaySpeed();
if (m_playback_state & PLAYBACK_STATE_PLAYING)
... | @@ -92,7 +92,6 @@
#include <androidjni/NetworkInfo.h>
#include <androidjni/PackageManager.h>
#include <androidjni/Resources.h>
-#include <androidjni/StatFs.h>
#include <androidjni/System.h>
#include <androidjni/SystemClock.h>
#include <androidjni/SystemProperties.h>
@@ -106,8 +105,6 @@
#include <rapidjson/docume... | xbmc/platform/android/activity/XBMCApp.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Android] Move GetStorageUsage function to CAndroidStorageProvider | 25,478 | xbmc/xbmc | 17,740 | C++ | joseluismarti | |
.setActions(CJNIPlaybackState::PLAYBACK_POSITION_UNKNOWN);
m_mediaSession->updatePlaybackState(builder.build());
m_mediaSessionUpdated = true;
}
}
void CXBMCApp::OnPlayBackStarted()
{
CLog::Log(LOGDEBUG, "{}", __PRETTY_FUNCTION__);
const auto& components = CServiceBroker::GetAppComponents();
co... | No issues found. | .setActions(CJNIPlaybackState::PLAYBACK_POSITION_UNKNOWN);
m_mediaSession->updatePlaybackState(builder.build());
m_mediaSessionUpdated = true;
}
}
void CXBMCApp::OnPlayBackStarted()
{
CLog::Log(LOGDEBUG, "{}", __PRETTY_FUNCTION__);
const auto& components = CServiceBroker::GetAppComponents();
co... | @@ -70,7 +70,6 @@
#include <android/log.h>
#include <android/native_window.h>
#include <android/native_window_jni.h>
-#include <androidjni/ActivityManager.h>
#include <androidjni/ApplicationInfo.h>
#include <androidjni/BitmapFactory.h>
#include <androidjni/BroadcastReceiver.h>
@@ -262,8 +261,6 @@ void CXBMCApp::o... | xbmc/platform/android/activity/XBMCApp.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Android] Move MemoryInfo logic to MemUtils | 25,485 | xbmc/xbmc | 17,740 | C++ | joseluismarti | |
for (const auto& line : StringUtils::Split(buffer.data(), '\n'))
{
if (line.find("vendor_id") != std::string::npos)
m_cpuVendor = line.substr(line.find(':') + 2);
else if (line.find("model name") != std::string::npos)
m_cpuModel = line.substr(line.find(':') + 2);
... | No issues found. | for (const auto& line : StringUtils::Split(buffer.data(), '\n'))
{
if (line.find("vendor_id") != std::string::npos)
m_cpuVendor = line.substr(line.find(':') + 2);
else if (line.find("model name") != std::string::npos)
m_cpuModel = line.substr(line.find(':') + 2);
... | @@ -9,10 +9,8 @@
#include "CPUInfoAndroid.h"
#include "URL.h"
+#include "cpu-features.h"
#include "utils/StringUtils.h"
-#include "utils/Temperature.h"
-
-#include "platform/android/activity/AndroidFeatures.h"
#include <array>
@@ -54,7 +52,7 @@ CCPUInfoAndroid::CCPUInfoAndroid() : m_posixFile(std::make_unique... | xbmc/platform/android/CPUInfoAndroid.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Android] Move AndroidFeatures logic to CPUInfoAndroid | 25,502 | xbmc/xbmc | 17,740 | C++ | joseluismarti | |
int64_t size = 0;
for (int i = 0; i < items.Size(); i++)
{
if (items[i]->m_bIsFolder)
continue;
size += items[i]->m_dwSize;
std::string pack,dummy;
CAddonVersion::SplitFileName(pack, dummy, items[i]->GetLabel());
result.try_emplace(pack, std::make_unique<CFileItemList>());
result[pa... | No issues found. | int64_t size = 0;
for (int i = 0; i < items.Size(); i++)
{
if (items[i]->m_bIsFolder)
continue;
size += items[i]->m_dwSize;
std::string pack,dummy;
CAddonVersion::SplitFileName(pack, dummy, items[i]->GetLabel());
result.try_emplace(pack, std::make_unique<CFileItemList>());
result[pa... | @@ -625,8 +625,7 @@ int64_t CAddonInstaller::EnumeratePackageFolder(
size += items[i]->m_dwSize;
std::string pack,dummy;
CAddonVersion::SplitFileName(pack, dummy, items[i]->GetLabel());
- if (result.find(pack) == result.end())
- result[pack] = std::make_unique<CFileItemList>();
+ result.try_em... | xbmc/addons/AddonInstaller.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | xbmc/addons: cppcheck performance fixes | 25,515 | xbmc/xbmc | 17,740 | C++ | tobbi | |
CCurlFile::GetMimeType(GetDynURL(), m_mimetype);
// try to get mime-type again but with an NSPlayer User-Agent
// in order for server to provide correct mime-type. Allows us
// to properly detect an MMS stream
if (StringUtils::StartsWithNoCase(m_mimetype, "video/x-ms-"))
CCurlFil... | No issues found. | CCurlFile::GetMimeType(GetDynURL(), m_mimetype);
// try to get mime-type again but with an NSPlayer User-Agent
// in order for server to provide correct mime-type. Allows us
// to properly detect an MMS stream
if (StringUtils::StartsWithNoCase(m_mimetype, "video/x-ms-"))
CCurlFil... | @@ -116,7 +116,7 @@ CFileItem::CFileItem(const CMusicInfoTag& music)
m_strPath = music.GetURL();
m_bIsFolder = URIUtils::HasSlashAtEnd(m_strPath);
*GetMusicInfoTag() = music;
- FillInDefaultIcon();
+ ART::FillInDefaultIcon(*this);
FillInMimeType(false);
}
@@ -1220,130 +1220,6 @@ bool CFileItem::IsReadO... | xbmc/FileItem.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | changed: move CFileItem::FillInDefaultIcon to ArtUtils | 25,539 | xbmc/xbmc | 17,740 | C++ | notspiff | |
#include <functional>
#include <map>
#include <utility>
using namespace PVR;
namespace
{
using ClientUIDParts = std::pair<std::string, ADDON::AddonInstanceId>;
static std::map<ClientUIDParts, int> s_idMap;
} // unnamed namespace
int CPVRClientUID::GetUID() const
{
if (!m_uidCreated)
{
const auto it = s_idMap... | No issues found. | #include <functional>
#include <map>
#include <utility>
using namespace PVR;
namespace
{
using ClientUIDParts = std::pair<std::string, ADDON::AddonInstanceId>;
static std::map<ClientUIDParts, int> s_idMap;
} // unnamed namespace
int CPVRClientUID::GetUID() const
{
if (!m_uidCreated)
{
const auto it = s_idMap... | @@ -8,26 +8,68 @@
#include "PVRClientUID.h"
+#include "pvr/PVRDatabase.h"
+#include "utils/log.h"
+
#include <functional>
+#include <map>
+#include <utility>
using namespace PVR;
+namespace
+{
+using ClientUIDParts = std::pair<std::string, ADDON::AddonInstanceId>;
+static std::map<ClientUIDParts, int> s_idMa... | xbmc/pvr/addons/PVRClientUID.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [PVR] Fix major design flaw to use std::hash value as persistent client UID | 25,590 | xbmc/xbmc | 17,740 | C++ | ksooo | |
std::string CURL::GetTranslatedProtocol() const
{
if (IsProtocol("shout")
|| IsProtocol("dav")
|| IsProtocol("rss"))
return "http";
if (IsProtocol("davs")
|| IsProtocol("rsss"))
return "https";
return GetProtocol();
}
std::string CURL::GetFileNameWithoutPath() const
{
// *.zip and *.rar sto... | No issues found. |
std::string CURL::GetTranslatedProtocol() const
{
if (IsProtocol("shout")
|| IsProtocol("dav")
|| IsProtocol("rss"))
return "http";
if (IsProtocol("davs")
|| IsProtocol("rsss"))
return "https";
return GetProtocol();
}
std::string CURL::GetFileNameWithoutPath() const
{
// *.zip and *.rar sto... | @@ -131,13 +131,16 @@ void CURL::Parse(std::string strURL1)
// ones that come to mind are iso9660, cdda, musicdb, etc.
// they are all local protocols and have no server part, port number, special options, etc.
// this removes the need for special handling below.
+ // clang-format off
if (
IsProtocol(... | xbmc/URL.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Enable file:// protocol in CURL and CCurlFile | 25,638 | xbmc/xbmc | 17,740 | C++ | basilgello | |
PVR_RECORDING_FLAG_IS_FINALE = (1 << 3),
/// @brief __0001 0000__ : This recording will be flagged as live.
PVR_RECORDING_FLAG_IS_LIVE = (1 << 4),
} PVR_RECORDING_FLAG;
///@}
//----------------------------------------------------------------------------
//==========================================... | No issues found. | PVR_RECORDING_FLAG_IS_FINALE = (1 << 3),
/// @brief __0001 0000__ : This recording will be flagged as live.
PVR_RECORDING_FLAG_IS_LIVE = (1 << 4),
} PVR_RECORDING_FLAG;
///@}
//----------------------------------------------------------------------------
//==========================================... | @@ -61,12 +61,13 @@ extern "C"
//============================================================================
/// @ingroup cpp_kodi_addon_pvr_Defs_Recording_PVRRecording
/// @brief Special @ref kodi::addon::PVRRecording::SetSeriesNumber() and
- /// @ref kodi::addon::PVRRecording::SetEpisodeNumber() value to i... | xbmc/addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_recordings.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [PVR] Expose EpisodePart for recordings | 25,643 | xbmc/xbmc | 17,740 | C++ | emveepee | |
const CAddonRecording tag{recording};
return addon->toAddon->GetRecordingSize(addon, &tag, &sizeInBytes);
},
m_clientCapabilities.SupportsRecordingsSize());
}
PVR_ERROR CPVRClient::GetTimersAmount(int& iTimers) const
{
iTimers = -1;
return DoAddonCall(
__func__,
[&iTimers](c... | No issues found. | const CAddonRecording tag{recording};
return addon->toAddon->GetRecordingSize(addon, &tag, &sizeInBytes);
},
m_clientCapabilities.SupportsRecordingsSize());
}
PVR_ERROR CPVRClient::GetTimersAmount(int& iTimers) const
{
iTimers = -1;
return DoAddonCall(
__func__,
[&iTimers](c... | @@ -1053,7 +1053,20 @@ PVR_ERROR CPVRClient::GetChannels(bool radio,
PVR_HANDLE_STRUCT handle = {};
handle.callerAddress = this;
handle.dataAddress = &channels;
- return addon->toAddon->GetChannels(addon, &handle, radio);
+ const PVR_ERROR error{addon->toAddon->GetChannels(addon... | xbmc/pvr/addons/PVRClient.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [PVR] Remember date and time channels were obtained from a client for… | 25,651 | xbmc/xbmc | 17,740 | C++ | ksooo | |
/// \anchor ListItem_RatingAndVotes
/// _string_,
/// @return The scraped rating and votes of the currently selected movie in a
/// container (1-10).
/// @param name - [opt] you can specify the name of the scraper to retrieve specific votes\,
/// for use in `dialogvideo... | No issues found. | /// \anchor ListItem_RatingAndVotes
/// _string_,
/// @return The scraped rating and votes of the currently selected movie in a
/// container (1-10).
/// @param name - [opt] you can specify the name of the scraper to retrieve specific votes\,
/// for use in `dialogvideo... | @@ -3889,6 +3889,33 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE },
/// @return The parental rating of the currently playing programme (PVR).
/// <p>
/// }
+/// \table_row3{ <b>`VideoPlayer.ParentalRatingCode`</b>,
+/// \anchor VideoPlayer_ParentalRating... | xbmc/GUIInfoManager.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [PVR][guilib][GUIInfoManager] Add support for VideoPlayer.ParentalRatingCode/Icon/Source | 25,664 | xbmc/xbmc | 17,740 | C++ | DeltaMikeCharlie | |
delete[] data;
sink->m_framesInBuffers -= frames;
sink = nullptr;
}
};
struct VoiceCallback : public IXAudio2VoiceCallback
{
VoiceCallback()
{
mBufferEnd.reset(CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE));
if (!mBufferEnd)
... | No issues found. | delete[] data;
sink->m_framesInBuffers -= frames;
sink = nullptr;
}
};
struct VoiceCallback : public IXAudio2VoiceCallback
{
VoiceCallback()
{
mBufferEnd.reset(CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE));
if (!mBufferEnd)
... | @@ -66,14 +66,27 @@ class CAESinkXAudio : public IAESink
mBufferEnd.reset(CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE));
if (!mBufferEnd)
{
- throw std::exception("CreateEvent");
+ throw std::exception("CreateEventEx BufferEnd");
}
+ i... | xbmc/cores/AudioEngine/Sinks/AESinkXAudio.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [AE][XAudio2] Fix Drain and Deinitialize | 25,668 | xbmc/xbmc | 17,740 | C++ | CrystalP | |
class CMusicDatabase;
class CVariant;
namespace JSONRPC
{
class CAudioLibrary : public CFileItemHandler
{
public:
static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS GetArtist... | No issues found. | class CMusicDatabase;
class CVariant;
namespace JSONRPC
{
class CAudioLibrary : public CFileItemHandler
{
public:
static JSONRPC_STATUS GetProperties(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result);
static JSONRPC_STATUS GetArtist... | @@ -69,6 +69,16 @@ namespace JSONRPC
static JSONRPC_STATUS GetAdditionalSongDetails(const CVariant& parameterObject,
const CFileItemList& items,
CMusicDatabase& musicdatabase);
+ static JSONRPC_STATUS Refresh... | xbmc/interfaces/json-rpc/AudioLibrary.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | [MUSIC][JSON-RPC] AudioLibrary.RefreshArtist and AudioLibrary.RefreshAlbum | 25,677 | xbmc/xbmc | 17,740 | C++ | acidzab | |
namespace KODI
{
namespace GAME
{
class CGameClient;
/**
* \ingroup games
*
* \brief C++ wrapper for properties to pass to the DLL
*
* Game client properties declared in addon-instance/Game.h.
*/
class CGameClientProperties
{
public:
CGameClientProperties(const CGameClient& parent, AddonProps_Game& props);
... | No issues found. |
namespace KODI
{
namespace GAME
{
class CGameClient;
/**
* \ingroup games
*
* \brief C++ wrapper for properties to pass to the DLL
*
* Game client properties declared in addon-instance/Game.h.
*/
class CGameClientProperties
{
public:
CGameClientProperties(const CGameClient& parent, AddonProps_Game& props);
... | @@ -78,6 +78,9 @@ class CGameClientProperties
void AddProxyDll(const GameClientPtr& gameClient);
bool HasProxyDll(const std::string& strLibPath) const;
+ // Utility functions
+ static bool InstallDependencies(const std::vector<std::string>& addons);
+
// Construction parameters
const CGameClient& m_pare... | xbmc/games/addons/GameClientProperties.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Games: Offer to install missing dependencies on game launch | 25,691 | xbmc/xbmc | 17,740 | C++ | garbear | |
m_iTimeshiftProgressStartTime = start;
bUpdatedStartTime = true;
}
}
if (!bUpdatedStartTime)
{
// default to ts buffer start
m_iTimeshiftProgressStartTime = m_iTimeshiftStartTime;
}
//////////////////////////////////////////////////////////////////////////////////////
// end time
... | No issues found. | m_iTimeshiftProgressStartTime = start;
bUpdatedStartTime = true;
}
}
if (!bUpdatedStartTime)
{
// default to ts buffer start
m_iTimeshiftProgressStartTime = m_iTimeshiftStartTime;
}
//////////////////////////////////////////////////////////////////////////////////////
// end time
... | @@ -20,6 +20,7 @@
#include "settings/SettingsComponent.h"
#include "utils/StringUtils.h"
+#include <chrono>
#include <cmath>
#include <ctime>
#include <memory>
@@ -82,7 +83,8 @@ void CPVRGUITimesInfo::UpdatePlayingTag()
else if (m_iTimeshiftEndTime > m_iTimeshiftStartTime)
{
m_playingEpgTa... | xbmc/pvr/guilib/guiinfo/PVRGUITimesInfo.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Fix some CPPCheck and compiler warnings | 25,719 | xbmc/xbmc | 17,740 | C++ | ksooo | |
IconTest{"favourites://1", "DefaultFavourites.png"},
IconTest{"/home/user/test.fil", "DefaultFile.png"},
IconTest{"/home/user/test.m3u", "DefaultPlaylist.png", "", true},
IconTest{"/home/user/test.xsp", "DefaultPlaylist.png", "", true},
IconTest{"..", "DefaultFolderBack.png", "", true},
IconTest... | No issues found. | IconTest{"favourites://1", "DefaultFavourites.png"},
IconTest{"/home/user/test.fil", "DefaultFile.png"},
IconTest{"/home/user/test.m3u", "DefaultPlaylist.png", "", true},
IconTest{"/home/user/test.xsp", "DefaultPlaylist.png", "", true},
IconTest{"..", "DefaultFolderBack.png", "", true},
IconTest... | @@ -138,10 +138,7 @@ const auto folder_thumb_tests = std::array{
"/home/user/bar/folder.jpg"},
FolderTest{"stack:///home/user/cd1/foo-cd1.avi , /home/user/cd2/foo-cd2.avi", "artist.jpg",
"/home/user/artist.jpg"},
- FolderTest{"zip://%2fhome%2fuser%2fbar.zip/foo.avi", "cover.png",... | xbmc/utils/test/TestArtUtils.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | fixed: GetFolderThumb for archives | 25,722 | xbmc/xbmc | 17,740 | C++ | notspiff | |
bool CFileItem::CanQueue() const
{
return m_bCanQueue;
}
void CFileItem::SetCanQueue(bool bYesNo)
{
m_bCanQueue = bYesNo;
}
bool CFileItem::IsParentFolder() const
{
return m_bIsParentFolder;
}
void CFileItem::FillInMimeType(bool lookup /*= true*/)
{
//! @todo adapt this to use CMime::GetMimeType()
if (m_m... | No issues found. |
bool CFileItem::CanQueue() const
{
return m_bCanQueue;
}
void CFileItem::SetCanQueue(bool bYesNo)
{
m_bCanQueue = bYesNo;
}
bool CFileItem::IsParentFolder() const
{
return m_bIsParentFolder;
}
void CFileItem::FillInMimeType(bool lookup /*= true*/)
{
//! @todo adapt this to use CMime::GetMimeType()
if (m_m... | @@ -1957,59 +1957,13 @@ std::string CFileItem::FindLocalArt(const std::string &artFile, bool useFolder)
return "";
}
-std::string CFileItem::GetLocalArtBaseFilename() const
-{
- bool useFolder = false;
- return GetLocalArtBaseFilename(useFolder);
-}
-
-std::string CFileItem::GetLocalArtBaseFilename(bool& useFol... | xbmc/FileItem.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | move GetLocalArtBaseFilename to ArtUtils | 25,730 | xbmc/xbmc | 17,740 | C++ | notspiff | |
Frame() = default;
virtual ~Frame();
int GetPitch() const { return m_pitch; }
unsigned char* m_pImage = nullptr;
unsigned int m_delay = 0;
private:
Frame(const Frame& src);
int m_pitch = 0;
unsigned int m_imageSize = 0;
unsigned int m_height = 0;
unsigned int m_width = 0;
};
struct MemBuffer
... | No issues found. |
Frame() = default;
virtual ~Frame();
int GetPitch() const { return m_pitch; }
unsigned char* m_pImage = nullptr;
unsigned int m_delay = 0;
private:
Frame(const Frame& src);
int m_pitch = 0;
unsigned int m_imageSize = 0;
unsigned int m_height = 0;
unsigned int m_width = 0;
};
struct MemBuffer
... | @@ -9,6 +9,8 @@
#pragma once
#include "iimage.h"
+
+#include <cstdint>
#include <memory>
extern "C" | xbmc/guilib/FFmpegImage.h | 0 | C/C++ | 1 | none | 16 | 51 | 51 | true | Include missing <cstdint> includes | 25,735 | xbmc/xbmc | 17,740 | C++ | parona-source | |
static winrt::hstring PKEY_AudioEndpoint_FullRangeSpeakers = L"{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 6";
static winrt::hstring PKEY_AudioEndpoint_Supports_EventDriven_Mode = L"{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 7";
static winrt::hstring PKEY_AudioEndpoint_JackSubType = L"{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 8";
... | No issues found. | static winrt::hstring PKEY_AudioEndpoint_FullRangeSpeakers = L"{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 6";
static winrt::hstring PKEY_AudioEndpoint_Supports_EventDriven_Mode = L"{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 7";
static winrt::hstring PKEY_AudioEndpoint_JackSubType = L"{1da5d803-d492-4edd-8c23-e0c0ffee7f0e} 8";
... | @@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2024 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#include "AESinkFactoryWin.h"
+#include "utils/log.h"
+
+#include "platform/win10/AsyncHelpers.h"
+#includ... | xbmc/cores/AudioEngine/Sinks/windows/AESinkFactoryWinRT.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | [Windows] Make XAudio2 work with Windows 8 and code improvements | 25,750 | xbmc/xbmc | 17,740 | C++ | CrystalP | |
thumb = infoMgr.GetImage(MUSICPLAYER_COVER, -1);
}
bool needrecaching = false;
std::string cachefile = CServiceBroker::GetTextureCache()->CheckCachedImage(thumb, needrecaching);
if (!cachefile.empty())
{
std::string actualfile = CSpecialProtocol::TranslatePath(cachefile);
CJNIBitmap bmp = CJNIBitm... | No issues found. | thumb = infoMgr.GetImage(MUSICPLAYER_COVER, -1);
}
bool needrecaching = false;
std::string cachefile = CServiceBroker::GetTextureCache()->CheckCachedImage(thumb, needrecaching);
if (!cachefile.empty())
{
std::string actualfile = CSpecialProtocol::TranslatePath(cachefile);
CJNIBitmap bmp = CJNIBitm... | @@ -81,7 +81,6 @@
#include <androidjni/Cursor.h>
#include <androidjni/Display.h>
#include <androidjni/DisplayManager.h>
-#include <androidjni/Environment.h>
#include <androidjni/File.h>
#include <androidjni/Intent.h>
#include <androidjni/IntentFilter.h>
@@ -1091,42 +1090,6 @@ int CXBMCApp::GetBatteryLevel() const... | xbmc/platform/android/activity/XBMCApp.cpp | 0 | C++ | 1 | none | 16 | 51 | 51 | true | Move CXBMCApp::GetExternalStorage to CAndroidStorageProvider | 25,792 | xbmc/xbmc | 17,740 | C++ | joseluismarti |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.