annotate libao2/ao_null.c @ 3310:21314bc5079e

framedrop extended
author jaf
date Tue, 04 Dec 2001 12:55:05 +0000
parents 981a9e5118ce
children 561de830fdf1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
1 #include <stdio.h>
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
2 #include <stdlib.h>
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
3
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
4 #include "audio_out.h"
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
5 #include "audio_out_internal.h"
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
6
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
7 static ao_info_t info =
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
8 {
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
9 "Null audio output",
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
10 "null",
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
11 "A'rpi",
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
12 ""
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
13 };
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
14
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
15 LIBAO_EXTERN(null)
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
16
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
17
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
18 // to set/get/query special features/parameters
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
19 static int control(int cmd,int arg){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
20 return -1;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
21 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
22
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
23 // open & setup audio device
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
24 // return: 1=success 0=fail
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
25 static int init(int rate,int channels,int format,int flags){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
26
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 1763
diff changeset
27 ao_data.outburst=4096;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
28
1763
6a39b29c5862 fixed ehh.
arpi
parents: 1038
diff changeset
29 return 0;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
30 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
31
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
32 // close audio device
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
33 static void uninit(){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
34
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
35 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
36
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
37 // stop playing and empty buffers (for seeking/pause)
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
38 static void reset(){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
39
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
40 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
41
1038
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
42 // stop playing, keep buffers (for pause)
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
43 static void audio_pause()
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
44 {
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
45 // for now, just call reset();
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
46 reset();
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
47 }
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
48
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
49 // resume playing, after audio_pause()
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
50 static void audio_resume()
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
51 {
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
52 }
b36fb1ae4b53 applied solaris8/netbsd/other fixes patch by J¸«ärgen Keil <jk@tools.de>
arpi_esp
parents: 1010
diff changeset
53
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
54 // return: how many bytes can be played without blocking
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
55 static int get_space(){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
56
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 1763
diff changeset
57 return ao_data.outburst;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
58 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
59
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
60 // plays 'len' bytes of 'data'
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
61 // it should round it down to outburst*n
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
62 // return: number of bytes played
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
63 static int play(void* data,int len,int flags){
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
64
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
65 return len;
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
66 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
67
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 1763
diff changeset
68 // return: delay in seconds between first and last sample in buffer
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 1763
diff changeset
69 static float get_delay(){
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
70
3095
981a9e5118ce interface to libao2 changed ao_plugin added
anders
parents: 1763
diff changeset
71 return 0.0;
954
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
72 }
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
73
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
74
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
75
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
76
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
77
db20b90dd34d audio out drivers
arpi_esp
parents:
diff changeset
78