Skip to content

Commit

Permalink
Also directly connect audio pin for elgato
Browse files Browse the repository at this point in the history
  • Loading branch information
jp9000 committed Sep 16, 2014
1 parent e55f4c1 commit 8195735
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions DShowPlugin/DeviceSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -744,10 +744,24 @@ bool DeviceSource::LoadFilters()

if(soundOutputType != 0)
{
if(!bDeviceHasAudio)
bConnected = SUCCEEDED(err = capture->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, audioDeviceFilter, NULL, audioFilter));
if (elgato && bDeviceHasAudio)
{
bConnected = false;

IPin *audioPin = GetOutputPin(deviceFilter, &MEDIATYPE_Audio);
if (audioPin)
{
bConnected = SUCCEEDED(err = graph->ConnectDirect(audioPin, audioFilter->GetCapturePin(), nullptr));
audioPin->Release();
}
}
else
bConnected = SUCCEEDED(err = capture->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, deviceFilter, NULL, audioFilter));
{
if(!bDeviceHasAudio)
bConnected = SUCCEEDED(err = capture->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, audioDeviceFilter, NULL, audioFilter));
else
bConnected = SUCCEEDED(err = capture->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Audio, deviceFilter, NULL, audioFilter));
}

if(!bConnected)
{
Expand Down

0 comments on commit 8195735

Please sign in to comment.