Commit 56c87312 authored by Kyle Robbertze's avatar Kyle Robbertze

New upstream version 0.4.0

parent a80908b1
0.4.0 (18-08-2018)
=====
* Use bytes instead of strings whenever appropriate.
0.3.1 (16-10-2017)
=====
* Fixed compilation with OCaml 4.06
......
#!/bin/sh
#!/bin/sh -e
if [ -d m4 ]; then
OPTIONS="-I m4"
......
This diff is collapsed.
This diff is collapsed.
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for ocaml-mm 0.3.1.
# Generated by GNU Autoconf 2.69 for ocaml-mm 0.4.0.
#
# Report bugs to <savonet-users@lists.sourceforge.net>.
#
......@@ -640,8 +640,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='ocaml-mm'
PACKAGE_TARNAME='ocaml-mm'
PACKAGE_VERSION='0.3.1'
PACKAGE_STRING='ocaml-mm 0.3.1'
PACKAGE_VERSION='0.4.0'
PACKAGE_STRING='ocaml-mm 0.4.0'
PACKAGE_BUGREPORT='savonet-users@lists.sourceforge.net'
PACKAGE_URL=''
......@@ -750,6 +750,7 @@ INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
AUTOCONF_INSTALL_FILES
TARGET_TOOLCHAIN
host_os
host_vendor
host_cpu
......@@ -1389,7 +1390,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures ocaml-mm 0.3.1 to adapt to many kinds of systems.
\`configure' configures ocaml-mm 0.4.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
......@@ -1455,7 +1456,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of ocaml-mm 0.3.1:";;
short | recursive ) echo "Configuration of ocaml-mm 0.4.0:";;
esac
cat <<\_ACEOF
......@@ -1583,7 +1584,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ocaml-mm configure 0.3.1
ocaml-mm configure 0.4.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
......@@ -1952,7 +1953,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ocaml-mm $as_me 0.3.1, which was
It was created by ocaml-mm $as_me 0.4.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
......@@ -3290,6 +3291,30 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target toolchain" >&5
$as_echo_n "checking target toolchain... " >&6; }
case "${host_os}" in
linux*)
TARGET_TOOLCHAIN="linux"
;;
mingw*)
TARGET_TOOLCHAIN="mingw"
;;
cygwin*)
TARGET_TOOLCHAIN="cygwin"
;;
darwin*)
TARGET_TOOLCHAIN="darwin"
;;
*)
TARGET_TOOLCHAIN="other"
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $TARGET_TOOLCHAIN" >&5
$as_echo "$TARGET_TOOLCHAIN" >&6; }
# AC_CANONICAL_HOST needs those files
AUTOCONF_INSTALL_FILES="config.guess config.sub install-sh m4/*.m4"
......@@ -5628,7 +5653,7 @@ $as_echo "$OCAML_STDLIB" >&6; }
# Check if caml/threads.h is present
old_CFLAGS=$FLAGS
old_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -I${OCAML_STDLIB}"
ac_fn_c_check_header_compile "$LINENO" "caml/threads.h" "ac_cv_header_caml_threads_h" "#include <caml/misc.h>
"
......@@ -5692,7 +5717,6 @@ CAMLLIBPATH=$OCAMLLIB
# Check whether --enable-pic was given.
if test "${enable_pic+set}" = set; then :
enableval=$enable_pic; enable_pic="$enableval"
......@@ -7564,7 +7588,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by ocaml-mm $as_me 0.3.1, which was
This file was extended by ocaml-mm $as_me 0.4.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
......@@ -7626,7 +7650,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ocaml-mm config.status 0.3.1
ocaml-mm config.status 0.4.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
......
AC_INIT([ocaml-mm],[0.3.1],[savonet-users@lists.sourceforge.net])
AC_INIT([ocaml-mm],[0.4.0],[savonet-users@lists.sourceforge.net])
VERSION=$PACKAGE_VERSION
AC_MSG_RESULT(configuring $PACKAGE_STRING)
......
......@@ -2,13 +2,13 @@
ifeq "no" "yes"
LIBS += alsa
endif
ifeq "yes" "yes"
ifeq "no" "yes"
LIBS += ao
endif
ifeq "no" "yes"
ifeq "yes" "yes"
LIBS += ffmpeg
endif
ifeq "yes" "yes"
ifeq "no" "yes"
LIBS += gstreamer
endif
ifeq "no" "yes"
......
OCAMLFLAGS = -g -w +A-4@5-7@8-9@11@12@20-35-44-45-50
OCAMLNCFLAGS =
OCAMLLDFLAGS = -linkall
CFLAGS = -I.. -g -Wall -O3
INCDIRS = .. /home/toots/.opam/system/lib/ao /home/toots/.opam/system/lib/gstreamer /home/toots/.opam/system/lib/bytes
CFLAGS = -g -O2 -I.. -g -Wall -O3
INCDIRS = .. /usr/lib/ocaml/bytes
NO_CUSTOM = yes
OCAMLDOCFLAGS = -sort -stars
ANNOTATE = yes
......@@ -27,4 +27,4 @@ PS2PDF = @PS2PDF@
OCAMLLIBPATH = /usr/lib/ocaml
OCAMLBEST = byte opt
INCDIRS+= .. /home/toots/.opam/system/lib/ao /home/toots/.opam/system/lib/gstreamer /home/toots/.opam/system/lib/bytes
INCDIRS+= .. /usr/lib/ocaml/bytes
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2014-09-12.12; # UTC
scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
......@@ -271,15 +271,18 @@ do
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
......@@ -288,6 +291,11 @@ do
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
......@@ -324,14 +332,16 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
......@@ -434,8 +444,8 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
......@@ -500,9 +510,9 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
......@@ -3,6 +3,29 @@ AC_DEFUN([AC_BASE_CHECKS],
dnl check for base compilers
AC_CANONICAL_HOST()
dnl Detect the target toolchain
AC_MSG_CHECKING([target toolchain])
case "${host_os}" in
linux*)
TARGET_TOOLCHAIN="linux"
;;
mingw*)
TARGET_TOOLCHAIN="mingw"
;;
cygwin*)
TARGET_TOOLCHAIN="cygwin"
;;
darwin*)
TARGET_TOOLCHAIN="darwin"
;;
*)
TARGET_TOOLCHAIN="other"
;;
esac
AC_MSG_RESULT([$TARGET_TOOLCHAIN])
AC_SUBST(TARGET_TOOLCHAIN)
# AC_CANONICAL_HOST needs those files
AUTOCONF_INSTALL_FILES="config.guess config.sub install-sh m4/*.m4"
AC_SUBST(AUTOCONF_INSTALL_FILES)
......@@ -13,7 +36,6 @@ AC_CHECK_TOOL([AR],[ar],no)
AC_SUBST(AR)
AC_CHECK_OCAML_COMPILERS()
dnl add some flags
AC_DETECT_PIC_FLAGS()
......
......@@ -24,7 +24,7 @@ AC_PROG_FINDLIB()
AC_CHECK_OCAML_STDLIB()
# Check if caml/threads.h is present
old_CFLAGS=$FLAGS
old_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -I${OCAML_STDLIB}"
AC_CHECK_HEADER([caml/threads.h],[CAML_THREADS=yes],[],[#include <caml/misc.h>])
CFLAGS=${old_CFLAGS}
......
......@@ -757,7 +757,7 @@ module Mono = struct
let volume = self#volume in
let omega = freq /. sr in
for i = 0 to len - 1 do
let t = fracf (float i *. omega +. phase) +. 0.25 in
let t = fracf (float i *. omega +. phase +. 0.25) in
buf.(ofs + i) <- volume *. (if t < 0.5 then 4. *. t -. 1. else 4. *. (1. -. t) -. 1.)
done;
phase <- mod_float (phase +. float len *. omega) 1.
......@@ -938,7 +938,7 @@ module U8 = struct
"caml_float_pcm_of_u8_native"
external of_audio :
float array array -> int -> string -> int -> int -> unit
float array array -> int -> Bytes.t -> int -> int -> unit
= "caml_float_pcm_to_u8"
end
......@@ -948,16 +948,14 @@ module S16LE = struct
let duration channels len = len / (2 * channels)
external of_audio :
float array array -> int -> string -> int -> int -> unit
float array array -> int -> Bytes.t -> int -> int -> unit
= "caml_float_pcm_to_s16le"
let make buf ofs len =
let slen = length (channels buf) len in
let sbuf = Bytes.to_string
(Bytes.create slen)
in
let sbuf = Bytes.create slen in
of_audio buf ofs sbuf 0 len;
sbuf
Bytes.to_string sbuf
external to_audio : string -> int -> float array array -> int -> int -> unit = "caml_float_pcm_convert_s16le_byte" "caml_float_pcm_convert_s16le_native"
end
......@@ -968,23 +966,21 @@ module S16BE = struct
let duration channels len = len / (2 * channels)
external of_audio :
float array array -> int -> string -> int -> int -> unit
float array array -> int -> Bytes.t -> int -> int -> unit
= "caml_float_pcm_to_s16be"
let make buf ofs len =
let slen = length (channels buf) len in
let sbuf = Bytes.to_string
(Bytes.create slen)
in
let sbuf = Bytes.create slen in
of_audio buf ofs sbuf 0 len;
sbuf
Bytes.to_string sbuf
external to_audio : string -> int -> float array array -> int -> int -> unit = "caml_float_pcm_convert_s16be_byte" "caml_float_pcm_convert_s16be_native"
end
module S24LE = struct
external of_audio :
float array array -> int -> string -> int -> int -> unit
float array array -> int -> Bytes.t -> int -> int -> unit
= "caml_float_pcm_to_s24le"
external to_audio : string -> int -> float array array -> int -> int -> unit = "caml_float_pcm_convert_s24le_byte" "caml_float_pcm_convert_s24le_native"
......@@ -992,7 +988,7 @@ end
module S32LE = struct
external of_audio :
float array array -> int -> string -> int -> int -> unit
float array array -> int -> Bytes.t -> int -> int -> unit
= "caml_float_pcm_to_s32le"
external to_audio : string -> int -> float array array -> int -> int -> unit = "caml_float_pcm_convert_s32le_byte" "caml_float_pcm_convert_s32le_native"
......
......@@ -307,7 +307,7 @@ val to_mono : buffer -> Mono.buffer
val of_mono : Mono.buffer -> buffer
module U8 : sig
val of_audio : buffer -> int -> string -> int -> int -> unit
val of_audio : buffer -> int -> Bytes.t -> int -> int -> unit
val to_audio : string -> int -> buffer -> int -> int -> unit
end
......@@ -317,7 +317,7 @@ module S16LE : sig
val duration : int -> int -> int
val of_audio : buffer -> int -> string -> int -> int -> unit
val of_audio : buffer -> int -> Bytes.t -> int -> int -> unit
val make : buffer -> int -> int -> string
......@@ -329,7 +329,7 @@ module S16BE : sig
val duration : int -> int -> int
val of_audio : buffer -> int -> string -> int -> int -> unit
val of_audio : buffer -> int -> Bytes.t -> int -> int -> unit
val make : buffer -> int -> int -> string
......@@ -337,13 +337,13 @@ module S16BE : sig
end
module S24LE : sig
val of_audio : buffer -> int -> string -> int -> int -> unit
val of_audio : buffer -> int -> Bytes.t -> int -> int -> unit
val to_audio : string -> int -> buffer -> int -> int -> unit
end
module S32LE : sig
val of_audio : buffer -> int -> string -> int -> int -> unit
val of_audio : buffer -> int -> Bytes.t -> int -> int -> unit
val to_audio : string -> int -> buffer -> int -> int -> unit
end
......
......@@ -43,6 +43,10 @@
#define INT24_MAX ((1 << 23) - 1)
#define INT24_MIN (-INT24_MAX)
#ifndef Bytes_val
#define Bytes_val String_val
#endif
typedef uint8_t int24_t[3];
static inline void int24_of_int32(int32_t x, int24_t d) {
......@@ -208,7 +212,7 @@ CAMLprim value caml_float_pcm_to_s32le(value a, value _offs, value _dst, value _
int nc = Wosize_val(a);
int dst_len = 4 * len * nc;
value src;
int32_t *dst = (int32_t*)String_val(_dst);
int32_t *dst = (int32_t*)Bytes_val(_dst);
if (nc == 0) CAMLreturn(Val_int(0));
......@@ -240,7 +244,7 @@ CAMLprim value caml_float_pcm_to_s24le(value a, value _offs, value _dst, value _
int nc = Wosize_val(a);
int dst_len = 3 * len * nc;
value src;
int24_t *dst = (int24_t*)String_val(_dst);
int24_t *dst = (int24_t*)Bytes_val(_dst);
if (nc == 0) CAMLreturn(Val_int(0));
......@@ -267,7 +271,7 @@ CAMLprim value caml_float_pcm_to_s16(value a, value _offs, value _dst, value _ds
int nc = Wosize_val(a);
int dst_len = 2 * len * nc;
value src;
int16_t *dst = (int16_t*)String_val(_dst);
int16_t *dst = (int16_t*)Bytes_val(_dst);
if (nc == 0) CAMLreturn(Val_int(0));
......@@ -323,7 +327,7 @@ CAMLprim value caml_float_pcm_to_u8(value a, value _offs,
int nc = Wosize_val(a);
int dst_len = len * nc;
value src;
uint8_t *dst = (uint8_t*)String_val(_dst);
uint8_t *dst = (uint8_t*)Bytes_val(_dst);
if (nc == 0) CAMLreturn(Val_int(0));
......@@ -348,7 +352,7 @@ CAMLprim value caml_float_pcm_of_u8_native(
{
CAMLparam2(_src, _dst) ;
CAMLlocal1(dstc) ;
char* src = String_val(_src) ;
const char* src = String_val(_src) ;
int offset = Int_val(_offset) ;
int len = Int_val(_length) ;
int dst_off = Int_val(_dst_off) ;
......@@ -381,7 +385,7 @@ CAMLprim value caml_float_pcm_convert_s32le_native(value _src, value _offset, va
{
CAMLparam2(_src, _dst) ;
CAMLlocal1(dstc) ;
char* src = String_val(_src) ;
const char* src = String_val(_src) ;
int offset = Int_val(_offset) ;
int len = Int_val(_length) ;
int dst_off = Int_val(_dst_off) ;
......@@ -413,7 +417,7 @@ CAMLprim value caml_float_pcm_convert_s24le_native(value _src, value _offset, va
{
CAMLparam2(_src, _dst) ;
CAMLlocal1(dstc) ;
char* src = String_val(_src) ;
const char* src = String_val(_src) ;
int offset = Int_val(_offset) ;
int len = Int_val(_length) ;
int dst_off = Int_val(_dst_off) ;
......@@ -445,7 +449,7 @@ CAMLprim value caml_float_pcm_convert_s16_native(value _src, value _offset, valu
{
CAMLparam2(_src, _dst) ;
CAMLlocal1(dstc) ;
char* src = String_val(_src) ;
const char* src = String_val(_src) ;
int offset = Int_val(_offset) ;
int len = Int_val(_length) ;
int dst_off = Int_val(_dst_off) ;
......
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