Fixed dst_format

This commit is contained in:
Armin Novak
2018-09-25 16:00:30 +02:00
parent 12f1cf9e35
commit 5aa4b702c0
3 changed files with 7 additions and 17 deletions

View File

@@ -50,7 +50,7 @@ struct _audin_server_context
size_t num_server_formats;
/* Server destination PCM audio format. Set by server. */
AUDIO_FORMAT dst_format;
AUDIO_FORMAT* dst_format;
/* Server preferred frames per packet. */
int frames_per_packet;

View File

@@ -32,12 +32,6 @@
#include <freerdp/log.h>
#define TAG SERVER_TAG("sample")
static AUDIO_FORMAT test_audio_formats[] =
{
{ WAVE_FORMAT_PCM, 2, 44100, 176400, 4, 16, 0, NULL },
{ WAVE_FORMAT_ALAW, 2, 22050, 44100, 2, 8, 0, NULL }
};
/**
* Function description
*
@@ -67,7 +61,8 @@ static UINT sf_peer_audin_open_result(audin_server_context* context, UINT32 resu
*
* @return 0 on success, otherwise a Win32 error code
*/
static UINT sf_peer_audin_receive_samples(audin_server_context* context, const void* buf, int nframes)
static UINT sf_peer_audin_receive_samples(audin_server_context* context, const void* buf,
int nframes)
{
WLog_DBG(TAG, "AUDIN receive %d frames.", nframes);
return CHANNEL_RC_OK;
@@ -78,15 +73,10 @@ void sf_peer_audin_init(testPeerContext* context)
context->audin = audin_server_context_new(context->vcm);
context->audin->rdpcontext = &context->_p;
context->audin->data = context;
context->audin->num_server_formats = server_audin_get_formats(&context->audin->server_formats);
context->audin->server_formats = test_audio_formats;
context->audin->num_server_formats =
sizeof(test_audio_formats) / sizeof(test_audio_formats[0]);
context->audin->dst_format.wFormatTag = 1;
context->audin->dst_format.nChannels = 2;
context->audin->dst_format.nSamplesPerSec = 44100;
context->audin->dst_format.wBitsPerSample = 16;
if (context->audin->num_server_formats > 0)
context->audin->dst_format = &context->audin->server_formats[0];
context->audin->Opening = sf_peer_audin_opening;
context->audin->OpenResult = sf_peer_audin_open_result;

View File

@@ -126,7 +126,7 @@ BOOL shadow_client_audin_init(rdpShadowClient* client)
if (audin->num_server_formats < 1)
goto fail;
audin->dst_format = audin->server_formats[0];
audin->dst_format = &audin->server_formats[0];
audin->Opening = AudinServerOpening;
audin->OpenResult = AudinServerOpenResult;
audin->ReceiveSamples = AudinServerReceiveSamples;