Commit ee3b48df authored by Jerome Laheurte's avatar Jerome Laheurte Committed by Tim-Philipp Müller

ksvideosrc: fix device enumeration when hotplugging a camera

Since both audio and video capture devices declare the KSCATEGORY_CAPTURE interface,
plugging a camera that supports both could result in an audio device being mistaken
for a video one.
parent 007f4137
......@@ -338,13 +338,14 @@ msg_window_message_proc (HWND window_handle, UINT message,
if (!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_CAPTURE) &&
!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_RENDER))
/* Since both video and audio capture device declare KSCATEGORY_CAPTURE, we filter on
KSCATEGORY_VIDEO here. To add audio support we should accept also KSCATEGORY_AUDIO. */
if (!IsEqualGUID (&bcdi->dbcc_classguid, &KSCATEGORY_VIDEO))
devices =
ks_enumerate_devices (&bcdi->dbcc_classguid,
if (devices == NULL)
......@@ -356,7 +357,7 @@ msg_window_message_proc (HWND window_handle, UINT message,
if ((source == NULL) &&
(g_ascii_strcasecmp (entry->path, bcdi->dbcc_name) == 0))
source = new_video_source (entry);
source = new_video_source (entry); /* Or audio source, not implemented yet */
ks_device_entry_free (entry);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment