Commit ee7e333b authored by Monty's avatar Monty

Commit channel mapping support to ogg123 for vorbis decode; still need

to add for speex/flac
Commit versioning changes for build to require new libao


svn path=/trunk/vorbis-tools/; revision=16811
parent c14df9d5
......@@ -189,7 +189,9 @@ fi
if test "x$build_ogg123" = xyes; then
AC_MSG_RESULT([checking for ogg123 requirements])
XIPH_PATH_AO(,build_ogg123=no; AC_MSG_WARN(libao missing))
AC_CHECK_MEMBER(ao_sample_format.matrix,,
build_ogg123=no; AC_MSG_WARN([libao too old; >= 1.0.0 needed]),
[#include <ao/ao.h>])
ACX_PTHREAD(,build_ogg123=no; AC_MSG_WARN(POSIX threads missing))
fi
......
......@@ -33,10 +33,11 @@ int audio_format_equal (audio_format_t *a, audio_format_t *b)
a->word_size == b->word_size &&
a->signed_sample == b->signed_sample &&
a->rate == b->rate &&
a->channels == b->channels;
a->channels == b->channels &&
((a->matrix==NULL && b->matrix==NULL) ||
!strcmp(a->matrix,b->matrix));
}
audio_device_t *append_audio_device(audio_device_t *devices_list,
int driver_id,
ao_option *options, char *filename)
......
......@@ -29,6 +29,7 @@ typedef struct audio_format_t {
int signed_sample;
int rate;
int channels;
char *matrix;
} audio_format_t;
......
......@@ -54,6 +54,7 @@ void audio_reopen_action (buf_t *buf, void *arg)
format.bits = reopen_arg->format->word_size * 8;
format.byte_format = reopen_arg->format->big_endian ?
AO_FMT_BIG : AO_FMT_LITTLE;
format.matrix = reopen_arg->format->matrix;
current = reopen_arg->devices;
......@@ -111,6 +112,8 @@ void audio_reopen_action (buf_t *buf, void *arg)
}
/* Cleanup argument */
if(reopen_arg->format->matrix)
free(reopen_arg->format->matrix);
free(reopen_arg->format);
free(reopen_arg);
}
......@@ -134,6 +137,8 @@ audio_reopen_arg_t *new_audio_reopen_arg (audio_device_t *devices,
arg->devices = devices;
/* Copy format in case fmt is recycled later */
*arg->format = *fmt;
if(fmt->matrix)
arg->format->matrix = strdup(fmt->matrix);
return arg;
}
......
......@@ -278,6 +278,18 @@ int parse_cmdline_options (int argc, char **argv,
NULL);
}
/* if verbosity has been altered, add options to drivers... */
{
audio_device_t *head = ogg123_opts->devices;
while (head){
if(ogg123_opts->verbosity>2)
ao_append_option(&(head->options),"verbose",NULL);
if(ogg123_opts->verbosity==0)
ao_append_option(&(head->options),"quiet",NULL);
head = head->next_device;
}
}
return optind;
}
......
......@@ -139,6 +139,36 @@ int ovf_read (decoder_t *decoder, void *ptr, int nbytes, int *eos,
decoder->actual_fmt.rate = priv->vi->rate;
decoder->actual_fmt.channels = priv->vi->channels;
switch(decoder->actual_fmt.channels){
case 1:
decoder->actual_fmt.matrix="M";
break;
case 2:
decoder->actual_fmt.matrix="L,R";
break;
case 3:
decoder->actual_fmt.matrix="L,C,R";
break;
case 4:
decoder->actual_fmt.matrix="L,R,BL,BR";
break;
case 5:
decoder->actual_fmt.matrix="L,C,R,BL,BR";
break;
case 6:
decoder->actual_fmt.matrix="L,C,R,BL,BR,LFE";
break;
case 7:
decoder->actual_fmt.matrix="L,C,R,SL,SR,BC,LFE";
break;
case 8:
decoder->actual_fmt.matrix="L,C,R,SL,SR,BL,BR,LFE";
break;
default:
decoder->actual_fmt.matrix=NULL;
break;
}
#ifdef HAVE_OV_READ_FILTER
vg_init(&priv->vg, priv->vc);
#endif
......
......@@ -445,7 +445,7 @@ int wav_open(FILE *in, oe_enc_opt *opt, unsigned char *oldbuf, int buflen)
format.mask = READ_U32_LE(buf+20); /* not used for now, not entirely clear it's useful */
format.format = READ_U16_LE(buf+24);
fprintf(stderr,"Channel mask: %x\n",format.mask);
}
if(!find_wav_chunk(in, "data", &len))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment