summaryrefslogtreecommitdiffstats
path: root/src/plugins/common
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-05 09:58:46 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-09-05 13:15:39 +0000
commitbe7f8d3a49fc6d5d31e6fe61f9ba2dec43341e90 (patch)
treee8d249300a22fed7fff1787449b9d3ad8e6c9f98 /src/plugins/common
parent8daa96db2991c24c9102e736413f79241813b7df (diff)
DirectShow: Fix clang-tidy warnings about else after return
- Unindent the code or replace by switch () - Smaller fixups when reindenting (nullptr, use QStringView for comparison against wchar_t) Change-Id: I249cb00b9ebe375b089d8d53b10c2d16d5771680 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/common')
-rw-r--r--src/plugins/common/evr/evrcustompresenter.cpp24
-rw-r--r--src/plugins/common/evr/evrhelpers.cpp8
2 files changed, 15 insertions, 17 deletions
diff --git a/src/plugins/common/evr/evrcustompresenter.cpp b/src/plugins/common/evr/evrcustompresenter.cpp
index 7a8985301..5ebde2dda 100644
--- a/src/plugins/common/evr/evrcustompresenter.cpp
+++ b/src/plugins/common/evr/evrcustompresenter.cpp
@@ -1582,12 +1582,10 @@ HRESULT EVRCustomPresenter::processOutput()
// Try to get a free sample from the video sample pool.
hr = m_samplePool.getSample(&sample);
- if (hr == MF_E_SAMPLEALLOCATOR_EMPTY) {
- // No free samples. Try again when a sample is released.
+ if (hr == MF_E_SAMPLEALLOCATOR_EMPTY) // No free samples. Try again when a sample is released.
return S_FALSE;
- } else if (FAILED(hr)) {
+ if (FAILED(hr))
return hr;
- }
// From now on, we have a valid video sample pointer, where the mixer will
// write the video data.
@@ -2020,23 +2018,23 @@ static QVideoFrame::PixelFormat pixelFormatFromMediaType(IMFMediaType *type)
if (subtype == MFVideoFormat_RGB32)
return QVideoFrame::Format_RGB32;
- else if (subtype == MFVideoFormat_ARGB32)
+ if (subtype == MFVideoFormat_ARGB32)
return QVideoFrame::Format_ARGB32;
- else if (subtype == MFVideoFormat_RGB24)
+ if (subtype == MFVideoFormat_RGB24)
return QVideoFrame::Format_RGB24;
- else if (subtype == MFVideoFormat_RGB565)
+ if (subtype == MFVideoFormat_RGB565)
return QVideoFrame::Format_RGB565;
- else if (subtype == MFVideoFormat_RGB555)
+ if (subtype == MFVideoFormat_RGB555)
return QVideoFrame::Format_RGB555;
- else if (subtype == MFVideoFormat_AYUV)
+ if (subtype == MFVideoFormat_AYUV)
return QVideoFrame::Format_AYUV444;
- else if (subtype == MFVideoFormat_I420)
+ if (subtype == MFVideoFormat_I420)
return QVideoFrame::Format_YUV420P;
- else if (subtype == MFVideoFormat_UYVY)
+ if (subtype == MFVideoFormat_UYVY)
return QVideoFrame::Format_UYVY;
- else if (subtype == MFVideoFormat_YV12)
+ if (subtype == MFVideoFormat_YV12)
return QVideoFrame::Format_YV12;
- else if (subtype == MFVideoFormat_NV12)
+ if (subtype == MFVideoFormat_NV12)
return QVideoFrame::Format_NV12;
return QVideoFrame::Format_Invalid;
diff --git a/src/plugins/common/evr/evrhelpers.cpp b/src/plugins/common/evr/evrhelpers.cpp
index 96b61e2eb..a315f1a73 100644
--- a/src/plugins/common/evr/evrhelpers.cpp
+++ b/src/plugins/common/evr/evrhelpers.cpp
@@ -69,7 +69,7 @@ bool qt_evr_areMediaTypesEqual(IMFMediaType *type1, IMFMediaType *type2)
{
if (!type1 && !type2)
return true;
- else if (!type1 || !type2)
+ if (!type1 || !type2)
return false;
DWORD dwFlags = 0;
@@ -84,10 +84,10 @@ HRESULT qt_evr_validateVideoArea(const MFVideoArea& area, UINT32 width, UINT32 h
float fOffsetY = qt_evr_MFOffsetToFloat(area.OffsetY);
if ( ((LONG)fOffsetX + area.Area.cx > (LONG)width) ||
- ((LONG)fOffsetY + area.Area.cy > (LONG)height) )
+ ((LONG)fOffsetY + area.Area.cy > (LONG)height) ) {
return MF_E_INVALIDMEDIATYPE;
- else
- return S_OK;
+ }
+ return S_OK;
}
bool qt_evr_isSampleTimePassed(IMFClock *clock, IMFSample *sample)