BOOL wf_peer_rdpsnd_init(wfPeerContext* context) { wfInfo* wfi; wfi = wf_info_get_instance(); wfi->snd_mutex = CreateMutex(NULL, FALSE, NULL); context->rdpsnd = rdpsnd_server_context_new(context->vcm); context->rdpsnd->data = context; context->rdpsnd->server_formats = test_audio_formats; context->rdpsnd->num_server_formats = sizeof(test_audio_formats) / sizeof(test_audio_formats[0]); context->rdpsnd->src_format.wFormatTag = 1; context->rdpsnd->src_format.nChannels = 2; context->rdpsnd->src_format.nSamplesPerSec = 44100; context->rdpsnd->src_format.wBitsPerSample = 16; context->rdpsnd->Activated = wf_peer_rdpsnd_activated; context->rdpsnd->Initialize(context->rdpsnd); wf_rdpsnd_set_latest_peer(context); wfi->snd_stop = FALSE; return TRUE; }
BOOL wf_peer_rdpsnd_init(wfPeerContext* context) { wfInfo* wfi = wf_info_get_instance(); if (!wfi) return FALSE; if (!(wfi->snd_mutex = CreateMutex(NULL, FALSE, NULL))) return FALSE; context->rdpsnd = rdpsnd_server_context_new(context->vcm); context->rdpsnd->rdpcontext = &context->_p; context->rdpsnd->data = context; context->rdpsnd->num_server_formats = server_rdpsnd_get_formats(&context->rdpsnd->server_formats); if (context->rdpsnd->num_server_formats > 0) context->rdpsnd->src_format = &context->rdpsnd->server_formats[0]; context->rdpsnd->Activated = wf_peer_rdpsnd_activated; context->rdpsnd->Initialize(context->rdpsnd, TRUE); wf_rdpsnd_set_latest_peer(context); wfi->snd_stop = FALSE; return TRUE; }