Commit fd0bc419 authored by Henri Fallon's avatar Henri Fallon

lpcm support (tested on 1 source only)

parent f213a1d6
...@@ -37,7 +37,7 @@ dnl Check for GNU make ...@@ -37,7 +37,7 @@ dnl Check for GNU make
dnl dnl
AC_PATH_PROG(GMAKE, gmake, no) AC_PATH_PROG(GMAKE, gmake, no)
if test "x${GMAKE}" = "xno"; then if test "x${GMAKE}" = "xno"; then
AC_CACHE_CHECK([whether GNU make is installed], AC_CACHE_CHECK([whether GNU make is installed],
[ac_cv_gmake], [ac_cv_gmake],
[if make --version | grep -q -i gnu; then [if make --version | grep -q -i gnu; then
ac_cv_gmake="yes" ac_cv_gmake="yes"
...@@ -46,9 +46,9 @@ if test "x${GMAKE}" = "xno"; then ...@@ -46,9 +46,9 @@ if test "x${GMAKE}" = "xno"; then
echo "You can get it from http://www.gnu.org/." echo "You can get it from http://www.gnu.org/."
exit exit
fi]) fi])
VLC_MAKE="make" VLC_MAKE="make"
else else
VLC_MAKE="gmake" VLC_MAKE="gmake"
fi fi
dnl Gettext stuff dnl Gettext stuff
...@@ -72,66 +72,66 @@ dnl ...@@ -72,66 +72,66 @@ dnl
dnl Check the operating system dnl Check the operating system
dnl dnl
case "x${target_os}" in case "x${target_os}" in
x) x)
SYS=unknown SYS=unknown
;; ;;
xlinux*) xlinux*)
SYS=linux SYS=linux
;; ;;
xbsdi*) xbsdi*)
SYS=bsdi SYS=bsdi
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}" save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd" dvd_LDFLAGS="${dvd_LDFLAGS} -ldvd"
vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd" vcd_LDFLAGS="${vcd_LDFLAGS} -ldvd"
;; ;;
x*bsd*) x*bsd*)
SYS="${target_os}" SYS="${target_os}"
save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}" save_CFLAGS="${save_CFLAGS} -pthread"; CFLAGS="${save_CFLAGS}"
;; ;;
xdarwin*) xdarwin*)
SYS=darwin SYS=darwin
save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"; CFLAGS="${save_CFLAGS}" save_CFLAGS="${save_CFLAGS} -no-cpp-precomp"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -all_load" vlc_LDFLAGS="${vlc_LDFLAGS} -all_load"
;; ;;
x*mingw32*) x*mingw32*)
SYS=mingw32 SYS=mingw32
AC_CHECK_TOOL(WINDRES, windres, :) AC_CHECK_TOOL(WINDRES, windres, :)
save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"; CFLAGS="${save_CFLAGS}" save_CFLAGS="${save_CFLAGS} -fnative-struct -D_OFF_T_ -D_off_t=long"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix" vlc_LDFLAGS="${vlc_LDFLAGS} -mwindows -Xlinker --force-exe-suffix"
vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32" vlc_LDFLAGS="${vlc_LDFLAGS} -lws2_32 -lnetapi32"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32" ipv4_LDFLAGS="${ipv4_LDFLAGS} -lws2_32"
ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32" ipv6_LDFLAGS="${ipv6_LDFLAGS} -lws2_32"
http_LDFLAGS="${http_LDFLAGS} -lws2_32" http_LDFLAGS="${http_LDFLAGS} -lws2_32"
rc_LDFLAGS="${rc_LDFLAGS} -lws2_32" rc_LDFLAGS="${rc_LDFLAGS} -lws2_32"
;; ;;
x*nto*) x*nto*)
SYS=nto SYS=nto
x11_LDFLAGS="${x11_LDFLAGS} -lsocket" x11_LDFLAGS="${x11_LDFLAGS} -lsocket"
xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket" xvideo_LDFLAGS="${xvideo_LDFLAGS} -lsocket"
;; ;;
xsolaris*) xsolaris*)
SYS=solaris SYS=solaris
;; ;;
xbeos) xbeos)
SYS=beos SYS=beos
save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}" save_CFLAGS="${save_CFLAGS} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${save_CFLAGS}"
vlc_LDFLAGS="${vlc_LDFLAGS} -lbe" vlc_LDFLAGS="${vlc_LDFLAGS} -lbe"
plugins_LDFLAGS="${plugins_LDFLAGS} -nostart" plugins_LDFLAGS="${plugins_LDFLAGS} -nostart"
beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker -lstdc++.r4" beos_LDFLAGS="${beos_LDFLAGS} -lbe -lgame -lroot -ltracker -lstdc++.r4"
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind" ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind"
;; ;;
x*) x*)
SYS="${target_os}" SYS="${target_os}"
;; ;;
esac esac
dnl Flags for plugin compilation dnl Flags for plugin compilation
if test "x${SYS}" = "xmingw32" if test "x${SYS}" = "xmingw32"
then then
plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct" plugins_CFLAGS="${plugins_CFLAGS} -fnative-struct"
else else
plugins_CFLAGS="${plugins_CFLAGS} -fPIC" plugins_CFLAGS="${plugins_CFLAGS} -fPIC"
plugins_LDFLAGS="${plugins_LDFLAGS} -fPIC" plugins_LDFLAGS="${plugins_LDFLAGS} -fPIC"
fi fi
dnl The -DSYS_FOO flag dnl The -DSYS_FOO flag
...@@ -141,17 +141,17 @@ dnl Check for system libs needed ...@@ -141,17 +141,17 @@ dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup) AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll strndup)
AC_CHECK_FUNC(connect,,[ AC_CHECK_FUNC(connect,,[
AC_CHECK_LIB(socket,connect, AC_CHECK_LIB(socket,connect,
ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket" ipv4_LDFLAGS="${ipv4_LDFLAGS} -lsocket"
vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket" vlc_LDFLAGS="${vlc_LDFLAGS} -lsocket"
)]) )])
AC_CHECK_FUNC(send,,[ AC_CHECK_FUNC(send,,[
AC_CHECK_LIB(socket,send, AC_CHECK_LIB(socket,send,
http_LDFLAGS="${http_LDFLAGS} -lsocket" http_LDFLAGS="${http_LDFLAGS} -lsocket"
)]) )])
AC_CHECK_FUNC(gethostbyname,,[ AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl",[ AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl",[
AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")]) AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")])
]) ])
have_nanosleep=0 have_nanosleep=0
AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[ AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
...@@ -162,42 +162,42 @@ AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[ ...@@ -162,42 +162,42 @@ AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
) )
]) ])
if test x$have_nanosleep = x1; then if test x$have_nanosleep = x1; then
AC_DEFINE(HAVE_NANOSLEEP, 1, AC_DEFINE(HAVE_NANOSLEEP, 1,
Define if nanosleep is available.) Define if nanosleep is available.)
fi fi
# HP/UX port # HP/UX port
AC_CHECK_LIB(rt,sem_init, [pthread_LDFLAGS="${pthread_LDFLAGS} -lrt"]) AC_CHECK_LIB(rt,sem_init, [pthread_LDFLAGS="${pthread_LDFLAGS} -lrt"])
AC_CHECK_FUNC(inet_aton,,[ AC_CHECK_FUNC(inet_aton,,[
AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv") AC_CHECK_LIB(resolv,inet_aton,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lresolv")
]) ])
AC_CHECK_FUNC(textdomain,,[ AC_CHECK_FUNC(textdomain,,[
AC_CHECK_LIB(intl,textdomain, AC_CHECK_LIB(intl,textdomain,
vlc_LDFLAGS="${vlc_LDFLAGS} -lintl" vlc_LDFLAGS="${vlc_LDFLAGS} -lintl"
plugins_LDFLAGS="${plugins_LDFLAGS} -lintl" plugins_LDFLAGS="${plugins_LDFLAGS} -lintl"
) )
]) ])
dnl Check for getopt dnl Check for getopt
NEED_GETOPT=0 NEED_GETOPT=0
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)], AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this: [ # FreeBSD has a gnugetopt library for this:
AC_CHECK_LIB([gnugetopt],[getopt_long], AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"], [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) vlc_LDFLAGS="${vlc_LDFLAGS} -lgnugetopt"],
[NEED_GETOPT=1])]) [NEED_GETOPT=1])])
AC_TYPE_SIGNAL AC_TYPE_SIGNAL
AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl") AC_CHECK_LIB(dl,dlopen,vlc_LDFLAGS="${vlc_LDFLAGS} -ldl")
AC_CHECK_LIB(m,cos, AC_CHECK_LIB(m,cos,
imdct_LDFLAGS="${imdct_LDFLAGS} -lm" imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm") filter_distort_LDFLAGS="${filter_distort_LDFLAGS} -lm")
AC_CHECK_LIB(m,pow, AC_CHECK_LIB(m,pow,
ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm" ffmpeg_LDFLAGS="${ffmpeg_LDFLAGS} -lm"
imdct_LDFLAGS="${imdct_LDFLAGS} -lm" imdct_LDFLAGS="${imdct_LDFLAGS} -lm"
imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm" imdct3dn_LDFLAGS="${imdct3dn_LDFLAGS} -lm"
imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm" imdctsse_LDFLAGS="${imdctsse_LDFLAGS} -lm"
i420_rgb_LDFLAGS="${i420_rgb_LDFLAGS} -lm" i420_rgb_LDFLAGS="${i420_rgb_LDFLAGS} -lm"
faad_LDFLAGS="${faad_LDFLAGS} -lm" faad_LDFLAGS="${faad_LDFLAGS} -lm"
) )
dnl Check for pthreads - borrowed from XMMS dnl Check for pthreads - borrowed from XMMS
...@@ -209,11 +209,11 @@ if test "x${THREAD_LIB}" = "xerror"; then ...@@ -209,11 +209,11 @@ if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads ${pthread_LDFLAGS}") AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads ${pthread_LDFLAGS}")
fi fi
if test "x${THREAD_LIB}" = "xerror"; then if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r") AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
fi fi
if test "x${THREAD_LIB}" = "xerror"; then if test "x${THREAD_LIB}" = "xerror"; then
AC_CHECK_FUNC(pthread_mutex_lock) AC_CHECK_FUNC(pthread_mutex_lock)
THREAD_LIB="" THREAD_LIB=""
fi fi
dnl Check for cthreads under GNU/Hurd for instance dnl Check for cthreads under GNU/Hurd for instance
...@@ -221,13 +221,13 @@ AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads") ...@@ -221,13 +221,13 @@ AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
dnl Check for misc headers dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[ AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1, AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_cond_t.)]) Define if <pthread.h> defines pthread_cond_t.)])
AC_EGREP_HEADER(pthread_once,pthread.h,[ AC_EGREP_HEADER(pthread_once,pthread.h,[
AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1, AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
Define if <pthread.h> defines pthread_once.)]) Define if <pthread.h> defines pthread_once.)])
AC_EGREP_HEADER(strncasecmp,strings.h,[ AC_EGREP_HEADER(strncasecmp,strings.h,[
AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1, AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Define if <strings.h> defines strncasecmp.)]) Define if <strings.h> defines strncasecmp.)])
dnl Check for headers dnl Check for headers
...@@ -242,13 +242,13 @@ AC_HEADER_TIME ...@@ -242,13 +242,13 @@ AC_HEADER_TIME
dnl Mac OS X and other OSes don't have declaration for nanosleep dnl Mac OS X and other OSes don't have declaration for nanosleep
AC_EGREP_HEADER(nanosleep,time.h,[ AC_EGREP_HEADER(nanosleep,time.h,[
AC_DEFINE(HAVE_DECL_NANOSLEEP, 1, AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
Define if <time.h> defines nanosleep.) Define if <time.h> defines nanosleep.)
]) ])
dnl Make sure we have timespecs dnl Make sure we have timespecs
AC_EGREP_HEADER(timespec,sys/time.h,[ AC_EGREP_HEADER(timespec,sys/time.h,[
AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1, AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
Define if <sys/time.h> defines struct timespec.) Define if <sys/time.h> defines struct timespec.)
]) ])
...@@ -257,10 +257,10 @@ AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h) ...@@ -257,10 +257,10 @@ AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
dnl Default X headers and libraries dnl Default X headers and libraries
if test "x${x_includes}" = "xNONE"; then if test "x${x_includes}" = "xNONE"; then
x_includes="/usr/X11R6/include" x_includes="/usr/X11R6/include"
fi fi
if test "x${x_libraries}" = "xNONE"; then if test "x${x_libraries}" = "xNONE"; then
x_libraries="/usr/X11R6/lib" x_libraries="/usr/X11R6/lib"
fi fi
dnl Build the gtk_main plugin? dnl Build the gtk_main plugin?
...@@ -269,77 +269,77 @@ NEED_GTK_MAIN=no ...@@ -269,77 +269,77 @@ NEED_GTK_MAIN=no
dnl Check for DPMS dnl Check for DPMS
if test "x${SYS}" != "xmingw32" if test "x${SYS}" != "xmingw32"
then then
CPPFLAGS="${save_CPPFLAGS} -I${x_includes}" CPPFLAGS="${save_CPPFLAGS} -I${x_includes}"
AC_CHECK_HEADERS(X11/extensions/dpms.h, [ AC_CHECK_HEADERS(X11/extensions/dpms.h, [
AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[ AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
AC_DEFINE(DPMSINFO_IN_DPMS_H, 1, AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
Define if <X11/extensions/dpms.h> defines DPMSInfo.) Define if <X11/extensions/dpms.h> defines DPMSInfo.)
]) ])
]) ])
CPPFLAGS="${save_CPPFLAGS}" CPPFLAGS="${save_CPPFLAGS}"
fi fi
dnl Check for ntohl, etc. dnl Check for ntohl, etc.
AC_CACHE_CHECK([for ntohl in sys/param.h], AC_CACHE_CHECK([for ntohl in sys/param.h],
[ac_cv_c_ntohl_sys_param_h], [ac_cv_c_ntohl_sys_param_h],
[CFLAGS="${save_CFLAGS} -Wall -Werror" [CFLAGS="${save_CFLAGS} -Wall -Werror"
AC_TRY_COMPILE([#include <sys/param.h>], AC_TRY_COMPILE([#include <sys/param.h>],
[void foo() { int meuh; ntohl(meuh); }], [void foo() { int meuh; ntohl(meuh); }],
ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)]) ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.) AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
fi fi
dnl Check for inline function size limit dnl Check for inline function size limit
AC_CACHE_CHECK([if \$CC accepts -finline-limit], AC_CACHE_CHECK([if \$CC accepts -finline-limit],
[ac_cv_c_inline_limit], [ac_cv_c_inline_limit],
[CFLAGS="${save_CFLAGS} -finline-limit-30000" [CFLAGS="${save_CFLAGS} -finline-limit-30000"
AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)]) AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
if test "x${ac_cv_c_inline_limit}" != "xno"; then if test "x${ac_cv_c_inline_limit}" != "xno"; then
save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}" save_CFLAGS="${save_CFLAGS} -finline-limit-30000"; CFLAGS="${save_CFLAGS}"
fi fi
dnl Check for -W or -w flags dnl Check for -W or -w flags
AC_CACHE_CHECK([if \$CC accepts -Wall -Winline], AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
[ac_cv_c_Wall_Winline], [ac_cv_c_Wall_Winline],
[CFLAGS="-Wall -Winline ${save_CFLAGS}" [CFLAGS="-Wall -Winline ${save_CFLAGS}"
AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)]) AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
if test "x${ac_cv_c_Wall_Winline}" != "xno"; then if test "x${ac_cv_c_Wall_Winline}" != "xno"; then
save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}" save_CFLAGS="-Wall -Winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
else else
AC_CACHE_CHECK([if \$CC accepts -wall -winline], AC_CACHE_CHECK([if \$CC accepts -wall -winline],
[ac_cv_c_wall_winline], [ac_cv_c_wall_winline],
[CFLAGS="-wall -winline ${save_CFLAGS}" [CFLAGS="-wall -winline ${save_CFLAGS}"
AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)]) AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
if test "x${ac_cv_c_wall_winline}" != "xno"; then if test "x${ac_cv_c_wall_winline}" != "xno"; then
save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}" save_CFLAGS="-wall -winline ${save_CFLAGS}"; CFLAGS="${save_CFLAGS}"
fi fi
fi fi
dnl Check for -pipe dnl Check for -pipe
AC_CACHE_CHECK([if \$CC accepts -pipe], AC_CACHE_CHECK([if \$CC accepts -pipe],
[ac_cv_c_pipe], [ac_cv_c_pipe],
[CFLAGS="${save_CFLAGS} -pipe" [CFLAGS="${save_CFLAGS} -pipe"
AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)]) AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
if test "x${ac_cv_c_pipe}" != "xno"; then if test "x${ac_cv_c_pipe}" != "xno"; then
save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}" save_CFLAGS="${save_CFLAGS} -pipe"; CFLAGS="${save_CFLAGS}"
fi fi
dnl Check for various optimization flags dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -O3], AC_CACHE_CHECK([if \$CC accepts -O3],
[ac_cv_c_o3], [ac_cv_c_o3],
[CFLAGS="${save_CFLAGS} -O3" [CFLAGS="${save_CFLAGS} -O3"
AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)]) AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
if test "x${ac_cv_c_o3}" != "xno"; then if test "x${ac_cv_c_o3}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3" CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
else else
AC_CACHE_CHECK([if \$CC accepts -O2], AC_CACHE_CHECK([if \$CC accepts -O2],
[ac_cv_c_o2], [ac_cv_c_o2],
[CFLAGS="${save_CFLAGS} -O2" [CFLAGS="${save_CFLAGS} -O2"
AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)]) AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
if test "x${ac_cv_c_o2}" != "xno"; then if test "x${ac_cv_c_o2}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2" CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
else else
AC_CACHE_CHECK([if \$CC accepts -O], AC_CACHE_CHECK([if \$CC accepts -O],
[ac_cv_c_o], [ac_cv_c_o],
[CFLAGS="${save_CFLAGS} -O" [CFLAGS="${save_CFLAGS} -O"
...@@ -347,60 +347,60 @@ else ...@@ -347,60 +347,60 @@ else
if test "x${ac_cv_c_o}" != "xno"; then if test "x${ac_cv_c_o}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -O" CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
fi fi
fi fi
fi fi
dnl Check for -ffast-math dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math], AC_CACHE_CHECK([if \$CC accepts -ffast-math],
[ac_cv_c_fast_math], [ac_cv_c_fast_math],
[CFLAGS="${save_CFLAGS} -ffast-math" [CFLAGS="${save_CFLAGS} -ffast-math"
AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)]) AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
if test "x${ac_cv_c_fast_math}" != "xno"; then if test "x${ac_cv_c_fast_math}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math" CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
fi fi
dnl Check for -funroll-loops dnl Check for -funroll-loops
AC_CACHE_CHECK([if \$CC accepts -funroll-loops], AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
[ac_cv_c_unroll_loops], [ac_cv_c_unroll_loops],
[CFLAGS="${save_CFLAGS} -funroll-loops" [CFLAGS="${save_CFLAGS} -funroll-loops"
AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)]) AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
if test "x${ac_cv_c_unroll_loops}" != "xno"; then if test "x${ac_cv_c_unroll_loops}" != "xno"; then
CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops" CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
fi fi
dnl Check for -fomit-frame-pointer dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer], AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
[ac_cv_c_omit_frame_pointer], [ac_cv_c_omit_frame_pointer],
[CFLAGS="${save_CFLAGS} -fomit-frame-pointer" [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)]) AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer" CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
# this plugin does not compile without -fomit-frame-pointer, damn gcc! # this plugin does not compile without -fomit-frame-pointer, damn gcc!
i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer" i420_yuy2_mmx_CFLAGS="${i420_yuy2_mmx_CFLAGS} -fomit-frame-pointer"
fi fi
dnl Check for Darwin plugin linking flags dnl Check for Darwin plugin linking flags
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic], AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
[ac_cv_ld_darwin], [ac_cv_ld_darwin],
[CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic" [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)]) AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test "x${ac_cv_ld_darwin}" != "xno"; then if test "x${ac_cv_ld_darwin}" != "xno"; then
plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic" plugins_LDFLAGS="${plugins_LDFLAGS} -bundle -undefined error -lcc_dynamic"
fi fi
dnl Check for standard plugin linking flags dnl Check for standard plugin linking flags
AC_CACHE_CHECK([if \$CC accepts -shared], AC_CACHE_CHECK([if \$CC accepts -shared],
[ac_cv_ld_plugins], [ac_cv_ld_plugins],
[CFLAGS="${save_CFLAGS} -shared" [CFLAGS="${save_CFLAGS} -shared"
AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)]) AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
if test "x${ac_cv_ld_plugins}" != "xno"; then if test "x${ac_cv_ld_plugins}" != "xno"; then
plugins_LDFLAGS="${plugins_LDFLAGS} -shared" plugins_LDFLAGS="${plugins_LDFLAGS} -shared"
fi fi
dnl Check for variadic macros dnl Check for variadic macros
AC_CACHE_CHECK([for variadic cpp macros], AC_CACHE_CHECK([for variadic cpp macros],
[ac_cv_cpp_variadic_macros], [ac_cv_cpp_variadic_macros],
[CFLAGS="${save_CFLAGS}" [CFLAGS="${save_CFLAGS}"
AC_TRY_COMPILE( AC_TRY_COMPILE(
[#include <stdio.h> [#include <stdio.h>
#define a(b,c...) printf(b,##c)], #define a(b,c...) printf(b,##c)],
...@@ -408,22 +408,22 @@ AC_CACHE_CHECK([for variadic cpp macros], ...@@ -408,22 +408,22 @@ AC_CACHE_CHECK([for variadic cpp macros],
ac_cv_cpp_variadic_macros=yes, ac_cv_cpp_variadic_macros=yes,
ac_cv_cpp_variadic_macros=no)]) ac_cv_cpp_variadic_macros=no)])
if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros) AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
fi fi
dnl Checks for __attribute__(aligned()) directive dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support], AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
[ac_cv_c_attribute_aligned], [ac_cv_c_attribute_aligned],
[ac_cv_c_attribute_aligned=0 [ac_cv_c_attribute_aligned=0
CFLAGS="${save_CFLAGS} -Werror" CFLAGS="${save_CFLAGS} -Werror"
for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
AC_TRY_COMPILE([], AC_TRY_COMPILE([],
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;], [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"]) [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
done done
CFLAGS="${save_CFLAGS}"]) CFLAGS="${save_CFLAGS}"])
if test "x${ac_cv_c_attribute_aligned}" != "x0"; then if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX], AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment]) [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
fi fi
...@@ -431,12 +431,12 @@ dnl ...@@ -431,12 +431,12 @@ dnl
dnl Check the CPU dnl Check the CPU
dnl dnl
case "x${target_cpu}" in case "x${target_cpu}" in
x) x)
ARCH=unknown ARCH=unknown
;; ;;
*) *)
ARCH="${target_cpu}" ARCH="${target_cpu}"
;; ;;
esac esac
dnl dnl
...@@ -447,10 +447,9 @@ PLUGINS="${PLUGINS} misc/dummy/dummy misc/null" ...@@ -447,10 +447,9 @@ PLUGINS="${PLUGINS} misc/dummy/dummy misc/null"
PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file misc/memcpy/memcpy" PLUGINS="${PLUGINS} control/rc/rc misc/logger/logger access/file misc/memcpy/memcpy"
PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts demux/a52sys" PLUGINS="${PLUGINS} demux/mpeg/es demux/mpeg/audio demux/mpeg/mpeg_system demux/mpeg/ps demux/mpeg/ts demux/a52sys"
PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec codec/mpeg_audio/mpeg_audio" PLUGINS="${PLUGINS} codec/mpeg_video/idct/idct codec/mpeg_video/idct/idctclassic codec/mpeg_video/motion/motion codec/mpeg_video/mpeg_video codec/spudec/spudec codec/mpeg_audio/mpeg_audio"
PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/a52old/a52old codec/a52" PLUGINS="${PLUGINS} codec/a52old/imdct/imdct codec/a52old/downmix/downmix codec/a52old/a52old codec/a52 codec/lpcm/lpcm"
#PLUGINS="${PLUGINS} codec/lpcm/lpcm"
PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop video_filter/motionblur" PLUGINS="${PLUGINS} video_filter/deinterlace/deinterlace video_filter/invert video_filter/wall video_filter/transform video_filter/distort video_filter/clone video_filter/crop video_filter/motionblur"
PLUGINS="${PLUGINS} audio_filter/converter/float32tos16 audio_filter/converter/float32tos8 audio_filter/converter/float32tou16 audio_filter/converter/float32tou8 audio_filter/converter/a52tospdif audio_filter/converter/fixed32tofloat32 audio_filter/converter/fixed32tos16 audio_filter/converter/s16tofloat32" PLUGINS="${PLUGINS} audio_filter/converter/float32tos16 audio_filter/converter/float32tos8 audio_filter/converter/float32tou16 audio_filter/converter/float32tou8 audio_filter/converter/a52tospdif audio_filter/converter/fixed32tofloat32 audio_filter/converter/fixed32tos16 audio_filter/converter/s16tofloat32 audio_filter/converter/s16tofloat32swab"
PLUGINS="${PLUGINS} audio_filter/resampler/trivial audio_filter/resampler/ugly" PLUGINS="${PLUGINS} audio_filter/resampler/trivial audio_filter/resampler/ugly"
PLUGINS="${PLUGINS} audio_filter/channel_mixer/trivial" PLUGINS="${PLUGINS} audio_filter/channel_mixer/trivial"
PLUGINS="${PLUGINS} audio_mixer/float32 audio_mixer/trivial audio_mixer/spdif" PLUGINS="${PLUGINS} audio_mixer/float32 audio_mixer/trivial audio_mixer/spdif"
......
/*****************************************************************************
* s16tofloat32.c : converter from signed 16 bits integer to float32
* with endianness change
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: s16tofloat32swab.c,v 1.1 2002/09/18 01:28:04 henri Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <errno.h>
#include <stdlib.h> /* malloc(), free() */
#include <string.h>
#include <vlc/vlc.h>
#include "audio_output.h"
#include "aout_internal.h"
/*****************************************************************************
* Local prototypes
*****************************************************************************/
static int Create ( vlc_object_t * );
static void DoWork ( aout_instance_t *, aout_filter_t *, aout_buffer_t *,
aout_buffer_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
vlc_module_begin();
set_description(
_("audio filter for s16->float32 with endianness conversion") );
set_capability( "audio filter", 1 );
set_callbacks( Create, NULL );
vlc_module_end();
/*****************************************************************************
* Create: allocate trivial mixer
*****************************************************************************
* This function allocates and initializes a Crop vout method.
*****************************************************************************/
static int Create( vlc_object_t *p_this )
{
aout_filter_t * p_filter = (aout_filter_t *)p_this;
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
if ( (p_filter->input.i_format == AOUT_FMT_S16_LE ||
p_filter->input.i_format == AOUT_FMT_S16_BE)
&& p_filter->output.i_format == AOUT_FMT_FLOAT32
&& p_filter->input.i_format != AOUT_FMT_S16_NE )
{
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = VLC_TRUE;
return 0;
}
return -1;
}
/*****************************************************************************
* DoWork: convert a buffer
*****************************************************************************/
static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
aout_buffer_t * p_in_buf, aout_buffer_t * p_out_buf )
{
int i = p_in_buf->i_nb_samples * p_filter->input.i_channels;
/* We start from the end because b_in_place is true */
s16 * p_in = (s16 *)p_in_buf->p_buffer + i - 1;
float * p_out = (float *)p_out_buf->p_buffer + i - 1;
#ifdef HAVE_SWAB
s16 * p_swabbed = malloc( i * sizeof(s16) );
swab( p_in_buf->p_buffer, p_swabbed,
i * sizeof(s16) );
p_in = p_swabbed +i - 1;
#else
byte_t temp;
#endif
while( i-- )
{
#ifndef HAVE_SWAB
temp = *(byte_t*)p_in;
*(byte_t*)p_in = *(byte_t*)p_in+1;
*(byte_t*)p_in+1 = temp;
#endif
*p_out = (float)*p_in / 32768.0;
p_in--; p_out--;
}
p_out_buf->i_nb_samples = p_in_buf->i_nb_samples;
p_out_buf->i_nb_bytes = p_in_buf->i_nb_bytes * 2;
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* lpcm.c: lpcm decoder module * lpcm.c: lpcm decoder module
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: lpcm.c,v 1.3 2002/08/30 22:22:24 massiot Exp $ * $Id: lpcm.c,v 1.4 2002/09/18 01:28:05 henri Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Henri Fallon <henri@videolan.org> * Henri Fallon <henri@videolan.org>
...@@ -25,19 +25,19 @@ ...@@ -25,19 +25,19 @@
/***************************************************************************** /*****************************************************************************
* Preamble * Preamble
*****************************************************************************/ *****************************************************************************/
#include <string.h> /* memcpy(), memset() */
#include <stdlib.h> /* malloc(), free() */ #include <stdlib.h> /* malloc(), free() */
#include <string.h> /* memcpy(), memset() */
#include <vlc/vlc.h> #include <vlc/vlc.h>
#include <vlc/aout.h> #include <vlc/aout.h>
#include <vlc/decoder.h> #include <vlc/decoder.h>
#include <input_ext-dec.h>
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
# include <unistd.h> /* getpid() */ # include <unistd.h> /* getpid() */
#endif #endif
#include "lpcm.h" #include "lpcm.h"
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
...@@ -45,7 +45,7 @@ static int OpenDecoder ( vlc_object_t * ); ...@@ -45,7 +45,7 @@ static int OpenDecoder ( vlc_object_t * );
static int RunDecoder ( decoder_fifo_t * ); static int RunDecoder ( decoder_fifo_t * );
void DecodeFrame ( lpcmdec_thread_t * ); void DecodeFrame ( lpcmdec_thread_t * );
static int InitThread ( lpcmdec_thread_t * ); // static int InitThread ( lpcmdec_thread_t * );
static void EndThread ( lpcmdec_thread_t * ); static void EndThread ( lpcmdec_thread_t * );
/***************************************************************************** /*****************************************************************************
...@@ -95,10 +95,25 @@ static int RunDecoder( decoder_fifo_t * p_fifo ) ...@@ -95,10 +95,25 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
*/ */
p_lpcmdec->p_fifo = p_fifo; p_lpcmdec->p_fifo = p_fifo;
if( InitThread( p_lpcmdec ) ) /* Init the BitStream */
InitBitstream( &p_lpcmdec->bit_stream, p_lpcmdec->p_fifo,
NULL, NULL );
/* FIXME : I suppose the number of channel ans sampling rate
* are someway in the headers */
p_lpcmdec->output_format.i_format = AOUT_FMT_S16_BE;
p_lpcmdec->output_format.i_channels = 2;
p_lpcmdec->output_format.i_rate = 48000;
aout_DateInit( &p_lpcmdec->end_date, 48000 );
p_lpcmdec->p_aout_input = aout_InputNew( p_lpcmdec->p_fifo,
&p_lpcmdec->p_aout,
&p_lpcmdec->output_format );
if( p_lpcmdec->p_aout_input == NULL )
{ {
DecoderError( p_fifo ); msg_Err( p_lpcmdec->p_fifo, "failed to create aout fifo" );
free( p_lpcmdec ); p_lpcmdec->p_fifo->b_error = 1;
return( -1 ); return( -1 );
} }
...@@ -120,67 +135,41 @@ static int RunDecoder( decoder_fifo_t * p_fifo ) ...@@ -120,67 +135,41 @@ static int RunDecoder( decoder_fifo_t * p_fifo )
return( 0 ); return( 0 );
} }
/*****************************************************************************
* InitThread : initialize an lpcm decoder thread
*****************************************************************************/
static int InitThread (lpcmdec_thread_t * p_lpcmdec)
{
/* Init the BitStream */
InitBitstream( &p_lpcmdec->bit_stream, p_lpcmdec->p_fifo,
NULL, NULL);
/* Creating the audio output fifo */
p_lpcmdec->p_aout_fifo =
aout_CreateFifo( p_lpcmdec->p_fifo, AOUT_FIFO_PCM,
2, 48000, LPCMDEC_FRAME_SIZE / 2, NULL );
if ( p_lpcmdec->p_aout_fifo == NULL )
{
return( -1 );
}
return( 0 );
}
/***************************************************************************** /*****************************************************************************
* DecodeFrame: decodes a frame. * DecodeFrame: decodes a frame.
*****************************************************************************/ *****************************************************************************/
void DecodeFrame( lpcmdec_thread_t * p_lpcmdec ) void DecodeFrame( lpcmdec_thread_t * p_lpcmdec )
{ {
byte_t * buffer; byte_t buffer[LPCMDEC_FRAME_SIZE];
#ifndef WORDS_BIGENDIAN
byte_t * p_temp[LPCMDEC_FRAME_SIZE]; aout_buffer_t * p_aout_buffer;
#endif mtime_t i_pts;
vlc_bool_t b_sync; vlc_bool_t b_sync;
int i_loop; int i_loop;
CurrentPTS( &p_lpcmdec->bit_stream, NextPTS( &p_lpcmdec->bit_stream, &i_pts, NULL );
&p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->i_end_frame],
NULL ); if( i_pts != 0 && i_pts != aout_DateGet( &p_lpcmdec->end_date ) )
if( !p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->i_end_frame] )
{ {
p_lpcmdec->p_aout_fifo->date[p_lpcmdec->p_aout_fifo->i_end_frame] = aout_DateSet( &p_lpcmdec->end_date, i_pts );
LAST_MDATE;
} }
buffer = ((byte_t *)p_lpcmdec->p_aout_fifo->buffer) + p_aout_buffer = aout_BufferNew( p_lpcmdec->p_aout,
(p_lpcmdec->p_aout_fifo->i_end_frame * LPCMDEC_FRAME_SIZE); p_lpcmdec->p_aout_input,
LPCMDEC_FRAME_SIZE/4 );
RemoveBits32(&p_lpcmdec->bit_stream);
#if 0
byte1 = GetBits(&p_lpcmdec->bit_stream, 8) ;
byte2 = GetBits(&p_lpcmdec->bit_stream, 8) ;
/* I only have 2 test streams. As far as I understand if( !p_aout_buffer )
* after the RemoveBits and the 2 GetBits, we should be exactly
* where we want : the sync word : 0x0180.
* If not, we go and find it. */
while( ( byte1 != 0x01 || byte2 != 0x80 ) && (!p_lpcmdec->p_fifo->b_die)
&& (!p_lpcmdec->p_fifo->b_error) )
{ {
byte1 = byte2; msg_Err( p_lpcmdec->p_fifo, "cannot get aout buffer" );
byte2 = GetBits(&p_lpcmdec->bit_stream, 8); p_lpcmdec->p_fifo->b_error = 1;
return;
} }
#else
p_aout_buffer->start_date = aout_DateGet( &p_lpcmdec->end_date );
p_aout_buffer->end_date = aout_DateIncrement( &p_lpcmdec->end_date,
LPCMDEC_FRAME_SIZE/4 );
b_sync = 0; b_sync = 0;
while( ( !p_lpcmdec->p_fifo->b_die ) && while( ( !p_lpcmdec->p_fifo->b_die ) &&
( !p_lpcmdec->p_fifo->b_error ) && ( !p_lpcmdec->p_fifo->b_error ) &&
...@@ -191,33 +180,18 @@ void DecodeFrame( lpcmdec_thread_t * p_lpcmdec ) ...@@ -191,33 +180,18 @@ void DecodeFrame( lpcmdec_thread_t * p_lpcmdec )
( GetBits( &p_lpcmdec->bit_stream, 8 ) != 0x01 ) ); ( GetBits( &p_lpcmdec->bit_stream, 8 ) != 0x01 ) );
b_sync = ( ShowBits( &p_lpcmdec->bit_stream, 8 ) == 0x80 ); b_sync = ( ShowBits( &p_lpcmdec->bit_stream, 8 ) == 0x80 );
} }
RemoveBits( &p_lpcmdec->bit_stream, 8 ); RemoveBits( &p_lpcmdec->bit_stream, 8 );
#endif
#ifndef WORDS_BIGENDIAN GetChunk( &p_lpcmdec->bit_stream, p_aout_buffer->p_buffer,
GetChunk( &p_lpcmdec->bit_stream, p_temp, LPCMDEC_FRAME_SIZE); LPCMDEC_FRAME_SIZE);
if( p_lpcmdec->p_fifo->b_die || p_lpcmdec->p_fifo->b_error ) return;
# ifdef HAVE_SWAB if( p_lpcmdec->p_fifo->b_die || p_lpcmdec->p_fifo->b_error )
swab( buffer, p_temp, LPCMDEC_FRAME_SIZE ); return;
# else
for( i_loop = 0; i_loop < LPCMDEC_FRAME_SIZE/2; i_loop++ )
{
buffer[2*i_loop]=p_temp[2*i_loop+1];
buffer[2*i_loop+1]=p_temp[2*i_loop];
}
# endif
#else aout_BufferPlay( p_lpcmdec->p_aout, p_lpcmdec->p_aout_input,
GetChunk( &p_lpcmdec->bit_stream, buffer, LPCMDEC_FRAME_SIZE); p_aout_buffer );
if( p_lpcmdec->p_fifo->b_die ) return;
#endif
vlc_mutex_lock (&p_lpcmdec->p_aout_fifo->data_lock);
p_lpcmdec->p_aout_fifo->i_end_frame =
(p_lpcmdec->p_aout_fifo->i_end_frame + 1) & AOUT_FIFO_SIZE;
vlc_cond_signal (&p_lpcmdec->p_aout_fifo->data_wait);
vlc_mutex_unlock (&p_lpcmdec->p_aout_fifo->data_lock);
} }
/***************************************************************************** /*****************************************************************************
...@@ -226,14 +200,10 @@ void DecodeFrame( lpcmdec_thread_t * p_lpcmdec ) ...@@ -226,14 +200,10 @@ void DecodeFrame( lpcmdec_thread_t * p_lpcmdec )
static void EndThread( lpcmdec_thread_t * p_lpcmdec ) static void EndThread( lpcmdec_thread_t * p_lpcmdec )
{ {
/* If the audio output fifo was created, we destroy it */ /* If the audio output fifo was created, we destroy it */
if( p_lpcmdec->p_aout_fifo != NULL ) if( p_lpcmdec->p_aout_input )
{ {
aout_DestroyFifo( p_lpcmdec->p_aout_fifo ); aout_InputDelete( p_lpcmdec->p_aout, p_lpcmdec->p_aout_input );
/* Make sure the output thread leaves the NextFrame() function */
vlc_mutex_lock( &(p_lpcmdec->p_aout_fifo->data_lock) );
vlc_cond_signal( &(p_lpcmdec->p_aout_fifo->data_wait) );
vlc_mutex_unlock( &(p_lpcmdec->p_aout_fifo->data_lock) );
} }
/* Destroy descriptor */ /* Destroy descriptor */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* lpcm.h : lpcm decoder module * lpcm.h : lpcm decoder module
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: lpcm.h,v 1.1 2002/08/04 17:23:42 sam Exp $ * $Id: lpcm.h,v 1.2 2002/09/18 01:28:05 henri Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -42,7 +42,10 @@ typedef struct lpcmdec_thread_s ...@@ -42,7 +42,10 @@ typedef struct lpcmdec_thread_s
/* /*
* Output properties * Output properties
*/ */
aout_fifo_t * p_aout_fifo; /* stores the decompressed audio frames */ aout_instance_t *p_aout;
aout_input_t *p_aout_input;
audio_sample_format_t output_format;
audio_date_t end_date;
/* The bit stream structure handles the PES stream at the bit level */ /* The bit stream structure handles the PES stream at the bit level */
bit_stream_t bit_stream; bit_stream_t bit_stream;
......
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