From 1a9d90c8452848fa4c0de39418c7f2959484e835 Mon Sep 17 00:00:00 2001 From: FBirth Date: Wed, 17 Sep 2014 14:43:47 +0200 Subject: [PATCH 1/2] Fix compiler warning --- OBSApi/Utility/XT_Windows.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OBSApi/Utility/XT_Windows.cpp b/OBSApi/Utility/XT_Windows.cpp index cce59eb16..b21a5ab92 100644 --- a/OBSApi/Utility/XT_Windows.cpp +++ b/OBSApi/Utility/XT_Windows.cpp @@ -339,7 +339,7 @@ BOOL STDCALL OSFileExists(CTSTR lpFile) bool STDCALL OSFileIsDirectory(CTSTR file) { - return (GetFileAttributes(file) & FILE_ATTRIBUTE_DIRECTORY); + return (FILE_ATTRIBUTE_DIRECTORY == (GetFileAttributes(file) & FILE_ATTRIBUTE_DIRECTORY)); } QWORD STDCALL OSGetFileModificationTime(String path) From 1c248ca82778d40806530177631d635f76848e24 Mon Sep 17 00:00:00 2001 From: FBirth Date: Wed, 17 Sep 2014 14:52:54 +0200 Subject: [PATCH 2/2] Fixed crash when connecting audio pin from Elgato device with audio renderer --- DShowPlugin/DeviceSource.cpp | 19 ++++++++++++++++++- DShowPlugin/DeviceSource.h | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/DShowPlugin/DeviceSource.cpp b/DShowPlugin/DeviceSource.cpp index 7caf945ba..693442acc 100644 --- a/DShowPlugin/DeviceSource.cpp +++ b/DShowPlugin/DeviceSource.cpp @@ -751,7 +751,24 @@ bool DeviceSource::LoadFilters() IPin *audioPin = GetOutputPin(deviceFilter, &MEDIATYPE_Audio); if (audioPin) { - bConnected = SUCCEEDED(err = graph->ConnectDirect(audioPin, audioFilter->GetCapturePin(), nullptr)); + IPin* audioRendererPin = NULL; + +#if 1 // FMB NOTE: Connect with first (= the only) pin of audio renderer + IEnumPins* pIEnum = NULL; + if (SUCCEEDED(err = audioFilter->EnumPins(&pIEnum))) + { + IPin* pIPin = NULL; + pIEnum->Next(1, &audioRendererPin, NULL); + SafeRelease(pIEnum); + } +#else + audioFilter->FindPin(L"Audio Input pin (rendered)", &audioRendererPin); +#endif + if (audioRendererPin) + { + bConnected = SUCCEEDED(err = graph->ConnectDirect(audioPin, audioRendererPin, nullptr)); + audioRendererPin->Release(); + } audioPin->Release(); } } diff --git a/DShowPlugin/DeviceSource.h b/DShowPlugin/DeviceSource.h index c4d801e50..9d7bc7333 100644 --- a/DShowPlugin/DeviceSource.h +++ b/DShowPlugin/DeviceSource.h @@ -115,7 +115,7 @@ class DeviceSource : public ImageSource IBaseFilter *deviceFilter; IBaseFilter *audioDeviceFilter; CaptureFilter *captureFilter; - CaptureFilter *audioFilter; + IBaseFilter *audioFilter; // Audio renderer filter //---------------------------------