aboutsummaryrefslogtreecommitdiffstats
path: root/audio/sdlaudio.c
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-09-14 14:32:27 -0700
committerDavid 'Digit' Turner <digit@google.com>2009-09-14 14:32:27 -0700
commit5d8f37ad78fc66901af50c762029a501561f3b23 (patch)
tree206790f8f21000850a98c4f9590a79e779106278 /audio/sdlaudio.c
parentcd059b15f2c7df69f4a087bd66900eb172e41d1c (diff)
downloadexternal_qemu-5d8f37ad78fc66901af50c762029a501561f3b23.zip
external_qemu-5d8f37ad78fc66901af50c762029a501561f3b23.tar.gz
external_qemu-5d8f37ad78fc66901af50c762029a501561f3b23.tar.bz2
Merge upstream QEMU 10.0.50 into the Android source tree.
This change integrates many changes from the upstream QEMU sources. Its main purpose is to enable correct ARMv6 and ARMv7 support to the Android emulator. Due to the nature of the upstream code base, this unfortunately also required changes to many other parts of the source. Note that to ensure easier integrations in the future, some source files and directories that have heavy Android-specific customization have been renamed with an -android suffix. The original files are still there for easier integration tracking, but *never* compiled. For example: net.c net-android.c qemu-char.c qemu-char-android.c slirp/ slirp-android/ etc... Tested on linux-x86, darwin-x86 and windows host machines.
Diffstat (limited to 'audio/sdlaudio.c')
-rw-r--r--audio/sdlaudio.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c
index ea5bccd..3e88785 100644
--- a/audio/sdlaudio.c
+++ b/audio/sdlaudio.c
@@ -23,10 +23,14 @@
*/
#include <SDL.h>
#include <SDL_thread.h>
+#include "qemu-common.h"
+#include "audio.h"
#ifndef _WIN32
#ifdef __sun__
#define _POSIX_PTHREAD_SEMANTICS 1
+#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
+#include <pthread.h>
#endif
#include <signal.h>
#endif
@@ -78,7 +82,7 @@ typedef struct SDLVoiceOut {
int decr;
} SDLVoiceOut;
-struct SDLAudioState {
+static struct SDLAudioState {
int exit;
SDL_mutex *mutex;
SDL_sem *sem;
@@ -337,7 +341,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len)
decr = to_mix;
while (to_mix) {
int chunk = audio_MIN (to_mix, hw->samples - hw->rpos);
- st_sample_t *src = hw->mix_buf + hw->rpos;
+ struct st_sample *src = hw->mix_buf + hw->rpos;
/* dolog ("in callback to_mix %d, chunk %d\n", to_mix, chunk); */
hw->clip (buf, src, chunk);
@@ -387,7 +391,7 @@ static int sdl_run_out (HWVoiceOut *hw)
int samples = bytes >> hw->info.shift;
int hwsamples = audio_MIN(hw->samples - hw->rpos, live);
uint8_t* dst = s->data + end;
- st_sample_t* src = hw->mix_buf + hw->rpos;
+ struct st_sample* src = hw->mix_buf + hw->rpos;
if (samples == 0)
break;
@@ -509,7 +513,7 @@ print_sdl_audiospec( SDL_AudioSpec* spec, const char* prefix )
}
#endif
-static int sdl_init_out (HWVoiceOut *hw, audsettings_t *as)
+static int sdl_init_out (HWVoiceOut *hw, struct audsettings *as)
{
SDLVoiceOut *sdl = (SDLVoiceOut *) hw;
SDLAudioState *s = &glob_sdl;
@@ -518,7 +522,7 @@ static int sdl_init_out (HWVoiceOut *hw, audsettings_t *as)
int endianess;
int err;
audfmt_e effective_fmt;
- audsettings_t obt_as;
+ struct audsettings obt_as;
shift <<= as->nchannels == 2;