summaryrefslogtreecommitdiffstats
path: root/libao2/ao_pcm.c
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-19 17:18:25 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-01-19 17:18:25 +0000
commit64489b4d0c384f68d0a4a1ff0f80fe4f059b6e83 (patch)
tree422ae6bfad9ea1fb83b9e0615f6244d0bc1d21b4 /libao2/ao_pcm.c
parentca8fc9929bdc71e2192a8fdbcab2eb0c1fb6191c (diff)
downloadmpv-64489b4d0c384f68d0a4a1ff0f80fe4f059b6e83.tar.bz2
mpv-64489b4d0c384f68d0a4a1ff0f80fe4f059b6e83.tar.xz
use MSTRZ suboption type
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14540 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_pcm.c')
-rw-r--r--libao2/ao_pcm.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c
index 28c14a2b0c..99374c2b19 100644
--- a/libao2/ao_pcm.c
+++ b/libao2/ao_pcm.c
@@ -80,27 +80,18 @@ static int control(int cmd,void *arg){
// return: 1=success 0=fail
static int init(int rate,int channels,int format,int flags){
int bits;
- strarg_t file;
opt_t subopts[] = {
{"waveheader", OPT_ARG_BOOL, &ao_pcm_waveheader, NULL},
- {"file", OPT_ARG_STR, &file, NULL},
+ {"file", OPT_ARG_MSTRZ, &ao_outputfilename, NULL},
{NULL}
};
// set defaults
ao_pcm_waveheader = 1;
- file.str = NULL;
- file.len = 0;
+ ao_outputfilename =
+ strdup((ao_pcm_waveheader)?"audiodump.wav":"audiodump.pcm");
if (subopt_parse(ao_subdevice, subopts) != 0) {
return 0;
}
- if (file.len > 0) {
- ao_outputfilename = malloc(file.len + 1);
- memcpy(ao_outputfilename, file.str, file.len);
- ao_outputfilename[file.len] = 0;
- }
- else
- ao_outputfilename =
- strdup((ao_pcm_waveheader)?"audiodump.wav":"audiodump.pcm");
/* bits is only equal to format if (format == 8) or (format == 16);
this means that the following "if" is a kludge and should