summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/phonon/ds9/qpin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/phonon/ds9/qpin.cpp')
-rw-r--r--src/3rdparty/phonon/ds9/qpin.cpp31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/3rdparty/phonon/ds9/qpin.cpp b/src/3rdparty/phonon/ds9/qpin.cpp
index 37fe48d1e0..68a4ec0c9d 100644
--- a/src/3rdparty/phonon/ds9/qpin.cpp
+++ b/src/3rdparty/phonon/ds9/qpin.cpp
@@ -28,20 +28,7 @@ namespace Phonon
namespace DS9
{
- static const AM_MEDIA_TYPE defaultMediaType()
- {
- AM_MEDIA_TYPE ret;
- ret.majortype = MEDIATYPE_NULL;
- ret.subtype = MEDIASUBTYPE_NULL;
- ret.bFixedSizeSamples = TRUE;
- ret.bTemporalCompression = FALSE;
- ret.lSampleSize = 1;
- ret.formattype = GUID_NULL;
- ret.pUnk = 0;
- ret.cbFormat = 0;
- ret.pbFormat = 0;
- return ret;
- }
+ static const AM_MEDIA_TYPE defaultMediaType = { MEDIATYPE_NULL, MEDIASUBTYPE_NULL, TRUE, FALSE, 1, GUID_NULL, 0, 0, 0};
class QEnumMediaTypes : public IEnumMediaTypes
{
@@ -159,7 +146,7 @@ namespace Phonon
QPin::QPin(QBaseFilter *parent, PIN_DIRECTION dir, const QVector<AM_MEDIA_TYPE> &mt) :
m_memAlloc(0), m_parent(parent), m_refCount(1), m_connected(0),
- m_direction(dir), m_mediaTypes(mt), m_connectedType(defaultMediaType()),
+ m_direction(dir), m_mediaTypes(mt), m_connectedType(defaultMediaType),
m_flushing(false)
{
Q_ASSERT(m_parent);
@@ -273,7 +260,7 @@ namespace Phonon
if (FAILED(hr)) {
setConnected(0);
- setConnectedType(defaultMediaType());
+ setConnectedType(defaultMediaType);
} else {
ComPointer<IMemInputPin> input(pin, IID_IMemInputPin);
if (input) {
@@ -315,10 +302,8 @@ namespace Phonon
}
setConnected(0);
- setConnectedType(defaultMediaType());
- if (m_direction == PINDIR_INPUT) {
- setMemoryAllocator(0);
- }
+ setConnectedType(defaultMediaType);
+ setMemoryAllocator(0);
return S_OK;
}
@@ -456,8 +441,8 @@ namespace Phonon
HRESULT QPin::checkOutputMediaTypesConnection(IPin *pin)
{
- IEnumMediaTypes *emt = 0;
- HRESULT hr = pin->EnumMediaTypes(&emt);
+ ComPointer<IEnumMediaTypes> emt;
+ HRESULT hr = pin->EnumMediaTypes(emt.pparam());
if (hr != S_OK) {
return hr;
}
@@ -470,7 +455,7 @@ namespace Phonon
freeMediaType(type);
return S_OK;
} else {
- setConnectedType(defaultMediaType());
+ setConnectedType(defaultMediaType);
freeMediaType(type);
}
}