}
if (audin->device == NULL)
+ {
+ /* If we have no audin device do not register plugin but still return OK or the client will
+ * just disconnect due to a missing microphone. */
WLog_Print(audin->log, WLOG_ERROR, "no sound device.");
+ error = CHANNEL_RC_OK;
+ goto out;
+ }
error = pEntryPoints->RegisterPlugin(pEntryPoints, "audin", (IWTSPlugin*)audin);
-out:
-
- if (error != CHANNEL_RC_OK)
- audin_plugin_terminated((IWTSPlugin*)audin);
+ if (error == CHANNEL_RC_OK)
+ return error;
+out:
+ audin_plugin_terminated((IWTSPlugin*)audin);
return error;
}
if (!winmm)
return CHANNEL_RC_NO_MEMORY;
+ if (waveOutGetNumDevs() == 0)
+ return ERROR_DEVICE_NOT_AVAILABLE;
+
winmm->device.Open = rdpsnd_winmm_open;
winmm->device.FormatSupported = rdpsnd_winmm_format_supported;
winmm->device.GetVolume = rdpsnd_winmm_get_volume;