summaryrefslogtreecommitdiffstats
path: root/libao2/ao_sdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libao2/ao_sdl.c')
-rw-r--r--libao2/ao_sdl.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/libao2/ao_sdl.c b/libao2/ao_sdl.c
index bdd11ab4c4..717a63e9da 100644
--- a/libao2/ao_sdl.c
+++ b/libao2/ao_sdl.c
@@ -11,6 +11,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include "audio_out.h"
#include "audio_out_internal.h"
@@ -57,6 +58,7 @@ static unsigned int buf_write_pos=0;
static int full_buffers=0;
static int buffered_bytes=0;
+
static int write_buffer(unsigned char* data,int len){
int len2=0;
int x;
@@ -105,6 +107,23 @@ static int read_buffer(unsigned char* data,int len){
#include <SDL/SDL.h>
#endif
+#if defined(sun) && defined(__svr4__)
+/* setenv is missing on solaris */
+static void setenv(const char *name, const char *val, int _xx)
+{
+ int len = strlen(name) + strlen(val) + 2;
+ char *env = malloc(len);
+
+ if (env != NULL) {
+ strcpy(env, name);
+ strcat(env, "=");
+ strcat(env, val);
+ putenv(env);
+ }
+}
+#endif
+
+
// to set/get/query special features/parameters
static int control(int cmd,int arg){
return -1;
@@ -196,6 +215,19 @@ static void reset(){
}
+// stop playing, keep buffers (for pause)
+static void audio_pause()
+{
+ // for now, just call reset();
+ reset();
+}
+
+// resume playing, after audio_pause()
+static void audio_resume()
+{
+}
+
+
// return: how many bytes can be played without blocking
static int get_space(){
return (NUM_BUFS-full_buffers)*BUFFSIZE - buf_write_pos;