Cleanup audio decoding code

This commit is contained in:
Iwan Timmer
2017-05-25 16:48:58 +02:00
parent 441bf6c7e0
commit fca16aa801
5 changed files with 34 additions and 57 deletions

View File

@@ -1,7 +1,7 @@
/*
* This file is part of Moonlight Embedded.
*
* Copyright (C) 2015 Iwan Timmer
* Copyright (C) 2015-2017 Iwan Timmer
*
* Moonlight is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -25,9 +25,6 @@
#include <stdio.h>
#include <opus_multistream.h>
#define MAX_CHANNEL_COUNT 6
#define FRAME_SIZE 240
static OpusMSDecoder* decoder;
static short pcmBuffer[FRAME_SIZE * MAX_CHANNEL_COUNT];
static SDL_AudioDeviceID dev;
@@ -35,12 +32,7 @@ static int channelCount;
static void sdl_renderer_init(int audioConfiguration, POPUS_MULTISTREAM_CONFIGURATION opusConfig) {
int rc;
decoder = opus_multistream_decoder_create(opusConfig->sampleRate,
opusConfig->channelCount,
opusConfig->streams,
opusConfig->coupledStreams,
opusConfig->mapping,
&rc);
decoder = opus_multistream_decoder_create(opusConfig->sampleRate, opusConfig->channelCount, opusConfig->streams, opusConfig->coupledStreams, opusConfig->mapping, &rc);
channelCount = opusConfig->channelCount;