[xiph-commits] r16811 - in trunk/vorbis-tools: . ogg123 oggenc
xiphmont at svn.xiph.org
xiphmont at svn.xiph.org
Mon Jan 25 20:34:31 PST 2010
Author: xiphmont
Date: 2010-01-25 20:34:31 -0800 (Mon, 25 Jan 2010)
New Revision: 16811
Modified:
trunk/vorbis-tools/configure.ac
trunk/vorbis-tools/ogg123/audio.c
trunk/vorbis-tools/ogg123/audio.h
trunk/vorbis-tools/ogg123/callbacks.c
trunk/vorbis-tools/ogg123/cmdline_options.c
trunk/vorbis-tools/ogg123/oggvorbis_format.c
trunk/vorbis-tools/oggenc/audio.c
Log:
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
Modified: trunk/vorbis-tools/configure.ac
===================================================================
--- trunk/vorbis-tools/configure.ac 2010-01-26 04:16:17 UTC (rev 16810)
+++ trunk/vorbis-tools/configure.ac 2010-01-26 04:34:31 UTC (rev 16811)
@@ -189,7 +189,9 @@
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
Modified: trunk/vorbis-tools/ogg123/audio.c
===================================================================
--- trunk/vorbis-tools/ogg123/audio.c 2010-01-26 04:16:17 UTC (rev 16810)
+++ trunk/vorbis-tools/ogg123/audio.c 2010-01-26 04:34:31 UTC (rev 16811)
@@ -33,10 +33,11 @@
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)
Modified: trunk/vorbis-tools/ogg123/audio.h
===================================================================
--- trunk/vorbis-tools/ogg123/audio.h 2010-01-26 04:16:17 UTC (rev 16810)
+++ trunk/vorbis-tools/ogg123/audio.h 2010-01-26 04:34:31 UTC (rev 16811)
@@ -29,6 +29,7 @@
int signed_sample;
int rate;
int channels;
+ char *matrix;
} audio_format_t;
Modified: trunk/vorbis-tools/ogg123/callbacks.c
===================================================================
--- trunk/vorbis-tools/ogg123/callbacks.c 2010-01-26 04:16:17 UTC (rev 16810)
+++ trunk/vorbis-tools/ogg123/callbacks.c 2010-01-26 04:34:31 UTC (rev 16811)
@@ -54,6 +54,7 @@
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 @@
}
/* Cleanup argument */
+ if(reopen_arg->format->matrix)
+ free(reopen_arg->format->matrix);
free(reopen_arg->format);
free(reopen_arg);
}
@@ -134,6 +137,8 @@
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;
}
Modified: trunk/vorbis-tools/ogg123/cmdline_options.c
===================================================================
--- trunk/vorbis-tools/ogg123/cmdline_options.c 2010-01-26 04:16:17 UTC (rev 16810)
+++ trunk/vorbis-tools/ogg123/cmdline_options.c 2010-01-26 04:34:31 UTC (rev 16811)
@@ -278,7 +278,19 @@
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;
}
Modified: trunk/vorbis-tools/ogg123/oggvorbis_format.c
===================================================================
--- trunk/vorbis-tools/ogg123/oggvorbis_format.c 2010-01-26 04:16:17 UTC (rev 16810)
+++ trunk/vorbis-tools/ogg123/oggvorbis_format.c 2010-01-26 04:34:31 UTC (rev 16811)
@@ -139,6 +139,36 @@
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
Modified: trunk/vorbis-tools/oggenc/audio.c
===================================================================
--- trunk/vorbis-tools/oggenc/audio.c 2010-01-26 04:16:17 UTC (rev 16810)
+++ trunk/vorbis-tools/oggenc/audio.c 2010-01-26 04:34:31 UTC (rev 16811)
@@ -445,7 +445,7 @@
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))
More information about the commits
mailing list