Author: janderwald
Date: Sun Oct 17 21:15:21 2010
New Revision: 49189
URL:
http://svn.reactos.org/svn/reactos?rev=49189&view=rev
Log:
[MMIXER]
- Apply a hack to filter out pins, which are not part of filter node processing path
- The hack filters out all pins which have a physical connection. Ideally the code should
check if the pin is part of a different rendering path and in that case remove the pin.
- Revert 49167
Modified:
trunk/reactos/lib/drivers/sound/mmixer/controls.c
Modified: trunk/reactos/lib/drivers/sound/mmixer/controls.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/sound/mmixer/c…
==============================================================================
--- trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/sound/mmixer/controls.c [iso-8859-1] Sun Oct 17 21:15:21
2010
@@ -772,6 +772,47 @@
return Status;
}
+VOID
+MMixerApplyOutputFilterHack(
+ IN PMIXER_CONTEXT MixerContext,
+ IN LPMIXER_DATA MixerData,
+ IN OUT PULONG PinsCount,
+ IN OUT PULONG Pins)
+{
+ ULONG Count = 0, Index;
+ MIXER_STATUS Status;
+ PKSPIN_PHYSICALCONNECTION Connection;
+
+ for(Index = 0; Index < *PinsCount; Index++)
+ {
+ /* check if it has a physical connection */
+ Status = MMixerGetPhysicalConnection(MixerContext, MixerData->hDevice,
Pins[Index], &Connection);
+
+ if (Status == MM_STATUS_SUCCESS)
+ {
+ /* remove pin */
+ MixerContext->Copy(&Pins[Index], &Pins[Index + 1], (*PinsCount -
(Index + 1)) * sizeof(ULONG));
+
+ /* free physical connection */
+ MixerContext->Free(Connection);
+
+ /* decrement index */
+ Index--;
+
+ /* decrement pin count */
+ (*PinsCount)--;
+ }
+ else
+ {
+ /* simple pin */
+ Count++;
+ }
+ }
+
+ /* store result */
+ *PinsCount = Count;
+}
+
MIXER_STATUS
MMixerHandlePhysicalConnection(
IN PMIXER_CONTEXT MixerContext,
@@ -797,7 +838,7 @@
return MM_STATUS_UNSUCCESSFUL;
}
- DPRINT("Name %S, Pin %lu bInput %lu\n",
OutConnection->SymbolicLinkName, OutConnection->Pin, bInput);
+ DPRINT("Name %S, Pin %lu bInput %lu\n", OutConnection->SymbolicLinkName,
OutConnection->Pin, bInput);
/* store connected mixer handle */
MixerInfo->hMixer = MixerData->hDevice;
@@ -832,10 +873,16 @@
/* return error code */
return Status;
}
+ /* HACK:
+ * some topologies do not have strict boundaries
+ * WorkArround: remove all pin ids which have a physical connection
+ * because bridge pins may belong to different render paths
+ */
+ MMixerApplyOutputFilterHack(MixerContext, MixerData, &PinsCount, Pins);
/* sanity checks */
ASSERT(PinsCount != 0);
- //ASSERT(PinsCount == 1);
+ ASSERT(PinsCount == 1);
/* create destination line */
Status = MMixerBuildMixerDestinationLine(MixerContext, MixerInfo, Pins[0],
bInput);