avoid creation of loopback connections

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3764 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
beveloper 2003-06-30 16:21:01 +00:00
parent af8d0a4d4e
commit b5a088d01f

View File

@ -562,6 +562,10 @@ AudioMixer::PrepareToConnect(const media_source &what, const media_destination &
PRINT_FORMAT("AudioMixer::PrepareToConnect: suggested format", *format);
// avoid loop connections
if (where.port == ControlPort())
return B_MEDIA_BAD_SOURCE;
// is the source valid?
if (what.port != ControlPort() || what.id != 0)
return B_MEDIA_BAD_SOURCE;