[Mplayer-cvslog] CVS: main aviheader.c,1.13,1.14 cfg-mplayer.h,1.57,1.58 configure,1.75,1.76 dec_audio.c,1.15,1.16 mixer.c,1.6,1.7 mixer.h,1.1,1.2 mplayer.c,1.153,1.154 stream.c,1.9,1.10 vcd_read.c,1.4,1.5 vcd_read_fbsd.c,1.1,1.2 version.sh,1.2,1.3

GEREOFFY arpi_esp at users.sourceforge.net
Tue Jun 5 20:40:46 CEST 2001


Update of /cvsroot/mplayer/main
In directory usw-pr-cvs1:/tmp/cvs-serv7869

Modified Files:
	aviheader.c cfg-mplayer.h configure dec_audio.c mixer.c 
	mixer.h mplayer.c stream.c vcd_read.c vcd_read_fbsd.c 
	version.sh 
Log Message:
applied solaris8/netbsd/other fixes patch by Jürgen Keil <jk at tools.de>

Index: aviheader.c
===================================================================
RCS file: /cvsroot/mplayer/main/aviheader.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** aviheader.c	2001/05/11 23:01:52	1.13
--- aviheader.c	2001/06/05 18:40:44	1.14
***************
*** 112,119 ****
        } else
        if(last_fccType==streamtypeAUDIO){
!         sh_audio->wf=calloc((chunksize<sizeof(WAVEFORMATEX))?sizeof(WAVEFORMATEX):chunksize,1);
  //        sh_audio->wf=malloc(chunksize); memset(sh_audio->wf,0,chunksize);
          if(verbose>=1) printf("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX));
          stream_read(demuxer->stream,(char*) sh_audio->wf,chunksize);
          chunksize=0;
          if(verbose>=1) print_wave_header(sh_audio->wf);
--- 112,124 ----
        } else
        if(last_fccType==streamtypeAUDIO){
! 	int wf_size = chunksize<sizeof(WAVEFORMATEX)?sizeof(WAVEFORMATEX):chunksize;
!         sh_audio->wf=calloc(wf_size,1);
  //        sh_audio->wf=malloc(chunksize); memset(sh_audio->wf,0,chunksize);
          if(verbose>=1) printf("found 'wf', %d bytes of %d\n",chunksize,sizeof(WAVEFORMATEX));
          stream_read(demuxer->stream,(char*) sh_audio->wf,chunksize);
+ 	if (sh_audio->wf->cbSize != 0 &&
+ 	    wf_size < sizeof(WAVEFORMATEX)+sh_audio->wf->cbSize) {
+ 	    sh_audio->wf=realloc(sh_audio->wf, sizeof(WAVEFORMATEX)+sh_audio->wf->cbSize);
+ 	}
          chunksize=0;
          if(verbose>=1) print_wave_header(sh_audio->wf);

Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** cfg-mplayer.h	2001/06/05 02:13:31	1.57
--- cfg-mplayer.h	2001/06/05 18:40:44	1.58
***************
*** 41,48 ****
  	{"dsp", &dsp, CONF_TYPE_STRING, 0, 0, 0},
          {"mixer", &mixer_device, CONF_TYPE_STRING, 0, 0, 0},
  #ifdef HAVE_X11
  	{"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0},
  #endif
-         {"master", &mixer_usemaster, CONF_TYPE_FLAG, 0, 0, 1},
  	{"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 2 },
  #ifdef HAVE_LIBCSS
--- 41,48 ----
  	{"dsp", &dsp, CONF_TYPE_STRING, 0, 0, 0},
          {"mixer", &mixer_device, CONF_TYPE_STRING, 0, 0, 0},
+         {"master", &mixer_usemaster, CONF_TYPE_FLAG, 0, 0, 1},
  #ifdef HAVE_X11
  	{"display", &mDisplayName, CONF_TYPE_STRING, 0, 0, 0},
  #endif
  	{"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 2 },
  #ifdef HAVE_LIBCSS

Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/configure,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -r1.75 -r1.76
*** configure	2001/06/05 11:20:14	1.75
--- configure	2001/06/05 18:40:44	1.76
***************
*** 1,3 ****
! #!/bin/bash
  
  #
--- 1,3 ----
! #!/bin/sh
  
  #
***************
*** 83,86 ****
--- 83,93 ----
  
  
+ # Check how echo works in this /bin/sh
+ case `echo -n` in
+ -n)     _echo_n=   _echo_c='\c';;
+ *)      _echo_n=-n _echo_c=;;
+ esac
+ 
+ 
  # LGB: Help moved here.
  
***************
*** 118,123 ****
  	--enable-lirc	        enable LIRC (remote control) support
  
!         --disable-alsa          disable alsa support [autodetect]
  	--disable-esd           disable esd sound support [autodetect]
  		
  	--disable-gcc-checking  disable gcc version checking
--- 125,132 ----
  	--enable-lirc	        enable LIRC (remote control) support
  
!         --disable-oss           disable OSS sound support [autodetect]
!         --disable-alsa          disable alsa sound support [autodetect]
  	--disable-esd           disable esd sound support [autodetect]
+         --disable-sun           disable Sun sound support [autodetect]
  		
  	--disable-gcc-checking  disable gcc version checking
***************
*** 180,183 ****
--- 189,193 ----
  
  _cc=gcc
+ _as=as
  _x11=auto
  
***************
*** 201,204 ****
--- 211,217 ----
          _cc=`echo $ac_option | cut -d '=' -f 2`
          ;;
+   --as=*)
+         _as=`echo $ac_option | cut -d '=' -f 2`
+         ;;
    --disable-gcc-checking)
          _skip_cc_check=yes
***************
*** 222,225 ****
--- 235,240 ----
  done
  
+ # ---
+ 
  # Checking CC version...
  # Q: what's with egcs, pgcc? - Atmos
***************
*** 228,232 ****
  # Since 3.0 is almost released we don't need to support them. - Nick 05 jun 2001
  if test "$_skip_cc_check" != "yes"; then
! echo -n "Checking version of $_cc ... "
  cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'`
  case $cc_version in
--- 243,247 ----
  # Since 3.0 is almost released we don't need to support them. - Nick 05 jun 2001
  if test "$_skip_cc_check" != "yes"; then
! echo $_echo_n "Checking version of $_cc ... $_echo_c"
  cc_version=`$_cc -v 2>&1 | sed -n 's/^.*version \([aegcygnustp-]*[0-9.]*\).*$/\1/p'`
  case $cc_version in
***************
*** 237,241 ****
  esac
  echo "$cc_version"
! if ! test -z "$cc_verc_fail"; then
  echo "Please downgrade(upgrade) gcc compiler to gcc-2.95.2+ or gcc-3.0+ version"
  exit
--- 252,256 ----
  esac
  echo "$cc_version"
! if [ ! -z "$cc_verc_fail" ] ; then
  echo "Please downgrade(upgrade) gcc compiler to gcc-2.95.2+ or gcc-3.0+ version"
  exit
***************
*** 245,258 ****
  fi
  # ---
  
! pname=`cat /proc/cpuinfo | grep 'model name' | cut -d ':' -f 2`
! pparam=`cat /proc/cpuinfo | grep 'features' | cut -d ':' -f 2`
  if [ -z "$pparam" ]; then
!   pparam=`cat /proc/cpuinfo | grep 'flags' | cut -d ':' -f 2`
  fi
! pvendor=`cat /proc/cpuinfo | grep 'vendor_id' | cut -d ':' -f 2  | cut -d ' ' -f 2`
! pfamily=`cat /proc/cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2`
! pmodel=`cat /proc/cpuinfo |grep -v 'model name'| grep "model" | cut -d ':' -f 2 | cut -d ' ' -f 2`
! pstepping=`cat /proc/cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2`
  
  _mmx=no
--- 260,284 ----
  fi
  # ---
+ 
+ 
+ if [ -r /proc/cpuinfo ]; then
+ 	# linux with /proc mounted, extract cpu information from it
+ 	_cpuinfo="cat /proc/cpuinfo"
+ else
+ 	# all other OS try to extract cpu information from a small helper
+ 	# program TOOLS/cpuinfo instead
+ 	$_cc -o TOOLS/cpuinfo TOOLS/cpuinfo.c
+ 	_cpuinfo="TOOLS/cpuinfo"
+ fi
  
! pname=`$_cpuinfo | grep 'model name' | cut -d ':' -f 2`
! pparam=`$_cpuinfo | grep 'features' | cut -d ':' -f 2`
  if [ -z "$pparam" ]; then
!   pparam=`$_cpuinfo | grep 'flags' | cut -d ':' -f 2`
  fi
! pvendor=`$_cpuinfo | grep 'vendor_id' | cut -d ':' -f 2  | cut -d ' ' -f 2`
! pfamily=`$_cpuinfo | grep 'cpu family' | cut -d ':' -f 2 | cut -d ' ' -f 2`
! pmodel=`$_cpuinfo | grep -v 'model name' | grep 'model' | cut -d ':' -f 2 | cut -d ' ' -f 2`
! pstepping=`$_cpuinfo | grep 'stepping' | cut -d ':' -f 2 | cut -d ' ' -f 2`
  
  _mmx=no
***************
*** 277,281 ****
  _dga2=no
  _svga=no
! _fbdev=yes
  _lirc=no
  _css=no
--- 303,308 ----
  _dga2=no
  _svga=no
! _fbdev=no
! [ x`uname -s` = xLinux ] && _fbdev=yes
  _lirc=no
  _css=no
***************
*** 288,291 ****
--- 315,319 ----
  _gllib=
  _sdllib=
+ _sdlcflags=
  _xvlib=
  _x11lib=
***************
*** 449,485 ****
  if [ "$proc" = "k7" ]; then
  #	echo -n "trying k7  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=athlon
  fi
  if [ "$proc" = "athlon" ]; then
  #	echo -n "trying athlon  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k6
  fi
  if [ "$proc" = "k6" ]; then
  #	echo -n "trying k6  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=k5
  fi
  if [ "$proc" = "k5" ]; then
  #	echo -n "trying k5  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium
  fi
  if [ "$proc" = "i686" ]; then
  #	echo -n "trying i686  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentiumpro
  fi
  if [ "$proc" = "pentiumpro" ]; then
  #	echo -n "trying pentiumpro  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=pentium
  fi
  if [ "$proc" = "pentium" ]; then
  #	echo -n "trying pentium  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i486
  fi
  if [ "$proc" = "i486" ]; then
  #	echo -n "trying i486  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=i386
  fi
  if [ "$proc" = "i386" ]; then
  #	echo -n "trying i386  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc &> /dev/null || proc=error
  fi
  if [ "$proc" = "error" ]; then
--- 477,513 ----
  if [ "$proc" = "k7" ]; then
  #	echo -n "trying k7  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=athlon
  fi
  if [ "$proc" = "athlon" ]; then
  #	echo -n "trying athlon  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=k6
  fi
  if [ "$proc" = "k6" ]; then
  #	echo -n "trying k6  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=k5
  fi
  if [ "$proc" = "k5" ]; then
  #	echo -n "trying k5  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=pentium
  fi
  if [ "$proc" = "i686" ]; then
  #	echo -n "trying i686  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=pentiumpro
  fi
  if [ "$proc" = "pentiumpro" ]; then
  #	echo -n "trying pentiumpro  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=pentium
  fi
  if [ "$proc" = "pentium" ]; then
  #	echo -n "trying pentium  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=i486
  fi
  if [ "$proc" = "i486" ]; then
  #	echo -n "trying i486  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=i386
  fi
  if [ "$proc" = "i386" ]; then
  #	echo -n "trying i386  "
! 	$_cc $TMPC -o $TMPO -march=$proc -mcpu=$proc > /dev/null 2>&1 || proc=error
  fi
  if [ "$proc" = "error" ]; then
***************
*** 492,505 ****
  
  
! $_cc $TMPC -o $TMPO -lvgagl -lvga &> /dev/null && _svga=yes
  
! $_cc $TMPC -o $TMPO -lpthread &> /dev/null || \
   { echo "Lib pthread not found."; rm -f $TMPC $TMPO $TMPS ; exit 1; }
  
  # Atmosfear: added SDL versioncheck and autodetect; removed warnings.
  _sdl=no
! if $_cc $TMPC -o $TMPO `$_sdlconfig --libs` &> /dev/null ; then
! 	if test `$_sdlconfig --version | sed s/[^0-9]//g` -gt 116 ; then
! 		if test `$_sdlconfig --version | sed s/[^0-9]//g` -lt 121 ; then
  
  			_sdlbuggy='#define BUGGY_SDL'
--- 520,534 ----
  
  
! $_cc $TMPC -o $TMPO -lvgagl -lvga > /dev/null 2>&1 && _svga=yes
  
! $_cc $TMPC -o $TMPO -lpthread > /dev/null 2>&1 || \
   { echo "Lib pthread not found."; rm -f $TMPC $TMPO $TMPS ; exit 1; }
  
  # Atmosfear: added SDL versioncheck and autodetect; removed warnings.
  _sdl=no
! if $_cc `$_sdlconfig --cflags` $TMPC -o $TMPO `$_sdlconfig --libs` > /dev/null 2>&1 ; then
! 	_sdlversion=`$_sdlconfig --version | sed 's/[^0-9]//g'`
! 	if test "$_sdlversion" -gt 116 ; then
! 		if test "$_sdlversion" -lt 121 ; then
  
  			_sdlbuggy='#define BUGGY_SDL'
***************
*** 515,528 ****
  # Atmosfear: added libcss autodetect
  _css=no
! if test -e "/usr/local/lib/libcss.so" ; then
  	_csslibdir="/usr/local/lib/"
! 	if test -e "/usr/local/include/css.h" ; then
  		_cssincdir="/usr/local/include"
  		_css=yes
  	fi	
  else
! 	if test -e "/usr/lib/libcss.so" ; then
  		_csslibdir="/usr/lib/"
! 		if test -e "/usr/include/css.h" ; then
  			_cssincdir="/usr/include/"
  			_css=yes
--- 544,557 ----
  # Atmosfear: added libcss autodetect
  _css=no
! if test -s "/usr/local/lib/libcss.so" ; then
  	_csslibdir="/usr/local/lib/"
! 	if test -s "/usr/local/include/css.h" ; then
  		_cssincdir="/usr/local/include"
  		_css=yes
  	fi	
  else
! 	if test -s "/usr/lib/libcss.so" ; then
  		_csslibdir="/usr/lib/"
! 		if test -s "/usr/include/css.h" ; then
  			_cssincdir="/usr/include/"
  			_css=yes
***************
*** 532,545 ****
  	
  _termcap=no
! $_cc $TMPC -o $TMPO -ltermcap &> /dev/null && _termcap=yes
  
  _png=no
! $_cc $TMPC -o $TMPO -lpng -lz -lm &> /dev/null && _png=yes
  
  _binutils=no
! as libac3/downmix/downmix_i386.S -o $TMPO &> /dev/null && _binutils=yes
  
  # echo binutils: $_binutils
  
  # ----------- Check X11 and related libs (GL, Xxf86vm, Xv, DGA) --------------
  
--- 561,575 ----
  	
  _termcap=no
! $_cc $TMPC -o $TMPO -ltermcap > /dev/null 2>&1 && _termcap=yes
  
  _png=no
! $_cc $TMPC -o $TMPO -lpng -lz -lm > /dev/null 2>&1 && _png=yes
  
  _binutils=no
! $_as libac3/downmix/downmix_i386.S -o $TMPO > /dev/null 2>&1 && _binutils=yes
  
  # echo binutils: $_binutils
  
+ 
  # ----------- Check X11 and related libs (GL, Xxf86vm, Xv, DGA) --------------
  
***************
*** 550,563 ****
  if [ $_x11 = auto ]; then
    _x11=no
!   $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext $_socklib &> /dev/null && _x11=yes
  fi
  
  if [ $_x11 = yes ]; then
  
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms $_socklib &> /dev/null && _xdpms=yes
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXv $_socklib &> /dev/null && _xv=yes
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXxf86vm $_socklib &> /dev/null && _vm=yes
  
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib &> /dev/null && _gl=yes
  
  cat > $TMPC << EOF
--- 580,593 ----
  if [ $_x11 = auto ]; then
    _x11=no
!   $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext $_socklib > /dev/null 2>&1 && _x11=yes
  fi
  
  if [ $_x11 = yes ]; then
  
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXdpms $_socklib > /dev/null 2>&1 && _xdpms=yes
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXv $_socklib > /dev/null 2>&1 && _xv=yes
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lXxf86vm $_socklib > /dev/null 2>&1 && _vm=yes
  
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib > /dev/null 2>&1 && _gl=yes
  
  cat > $TMPC << EOF
***************
*** 565,569 ****
  int main( void ) { return 0; }
  EOF
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib &> /dev/null || \
   { _gl=no; echo "GL includes not found!";}
  
--- 595,599 ----
  int main( void ) { return 0; }
  EOF
! $_cc $TMPC -o $TMPO $_x11libdir -lX11 -lXext -lGL $_socklib > /dev/null 2>&1 || \
   { _gl=no; echo "GL includes not found!";}
  
***************
*** 575,579 ****
  EOF
  
! $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib &> /dev/null && _dga=yes
  # Note: the -lXxf86vm library is the VideoMode extension and though it's
  # not needed for DGA, AFAIK every distribution packages together with DGA
--- 605,609 ----
  EOF
  
! $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib > /dev/null 2>&1 && _dga=yes
  # Note: the -lXxf86vm library is the VideoMode extension and though it's
  # not needed for DGA, AFAIK every distribution packages together with DGA
***************
*** 591,595 ****
  
  _dga2=no
! $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib &> /dev/null && _dga2=yes
  
  fi
--- 621,625 ----
  
  _dga2=no
! $_cc $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib > /dev/null 2>&1 && _dga2=yes
  
  fi
***************
*** 597,600 ****
--- 627,640 ----
  rm -f $TMPC $TMPO
  
+ 
+ # ---
+ # try to detect type of audio supported on this machine
+ 
+ _oss_audio=no
+ [ -c /dev/dsp ] && _oss_audio=yes
+ 
+ _sun_audio=no
+ [ -c /dev/audio -a -c /dev/audioctl ] && _sun_audio=yes
+ 
  # ---
  
***************
*** 607,613 ****
  _alsaver='not found'
  $_cc -o $TMPO -lasound $TMPC 2> /dev/null || _alsa=no
! [ $_alsa == 'yes' ] && $TMPO && { _alsaver='0.5.x'; }
  
! if [ "$_alsaver" == 'not found' ]; then
  cat > $TMPC << EOF
  #include <sys/asoundlib.h>
--- 647,653 ----
  _alsaver='not found'
  $_cc -o $TMPO -lasound $TMPC 2> /dev/null || _alsa=no
! [ $_alsa = 'yes' ] && $TMPO && { _alsaver='0.5.x'; }
  
! if [ "$_alsaver" = 'not found' ]; then
  cat > $TMPC << EOF
  #include <sys/asoundlib.h>
***************
*** 618,622 ****
  _alsaver='not found'
  $_cc -o $TMPO -lasound $TMPC 2> /dev/null || _alsa=no
! [ $_alsa == 'yes' ] && $TMPO && { _alsaver='0.9.x'; }
  fi
  
--- 658,662 ----
  _alsaver='not found'
  $_cc -o $TMPO -lasound $TMPC 2> /dev/null || _alsa=no
! [ $_alsa = 'yes' ] && $TMPO && { _alsaver='0.9.x'; }
  fi
  
***************
*** 646,650 ****
  	;;
    --enable-debug=*)
!         _debug=`echo -n '-g'; echo $ac_option | cut -d '=' -f 2`
  	;;
    --enable-css)
--- 686,690 ----
  	;;
    --enable-debug=*)
!         _debug=`echo '-g'; echo $ac_option | cut -d '=' -f 2`
  	;;
    --enable-css)
***************
*** 718,721 ****
--- 758,767 ----
  	_xmmp=yes
  	;;
+   --enable-ossaudio)
+   	_oss_audio=yes
+ 	;;
+   --enable-sunaudio)
+   	_sun_audio=yes
+ 	;;
    --enable-lirc)
  	_lirc=yes
***************
*** 808,811 ****
--- 854,863 ----
          _esd=no
          ;;
+   --disable-ossaudio)
+   	_oss_audio=no
+ 	;;
+   --disable-sunaudio)
+   	_sun_audio=no
+ 	;;
    --with-win32libdir=*)
          _win32libdir=`echo $ac_option | cut -d '=' -f 2`
***************
*** 833,842 ****
    --cc=*)
  	;;
   esac
  done
  
! # Checking assembler (as) compatibility...
! as_version=`as --version 2>&1 | sed -n 's/^.*assembler \([0-9.]*\).*$/\1/p'`
! echo -n "Checking assembler (as) ... $as_version, "
  _pref_as_version='2.9.1'
  ### this test disabled, see _binutils test above!  --A'rpi
--- 885,896 ----
    --cc=*)
  	;;
+   --as=*)
+ 	;;
   esac
  done
  
! # Checking assembler (_as) compatibility...
! as_version=`$_as --version 2>&1 | sed -n 's/^.*assembler \([0-9.]*\).*$/\1/p'`
! echo $_echo_n "Checking assembler (as) ... $as_version, $_echo_c"
  _pref_as_version='2.9.1'
  ### this test disabled, see _binutils test above!  --A'rpi
***************
*** 844,851 ****
  # filds -2(%ebp)
  # EOF
! # as astest.S -o astest.o &> /dev/null || as_verc_fail=yes
  
- if [ $_mmx = 'yes' ]; then
  cat > $TMPS <<EOF
  emms
  EOF
--- 898,909 ----
  # filds -2(%ebp)
  # EOF
! # $_as astest.S -o astest.o > /dev/null 2>&1 || as_verc_fail=yes
  
  cat > $TMPS <<EOF
+ nop
+ EOF
+ 
+ if [ $_mmx = 'yes' ]; then
+ cat >> $TMPS <<EOF
  emms
  EOF
***************
*** 886,890 ****
  #EOF
  #fi
! as $TMPS -o $TMPO &> /dev/null || as_verc_fail=yes
  rm -f $TMPS $TMPO $TMPC
  
--- 944,948 ----
  #EOF
  #fi
! $_as $TMPS -o $TMPO > /dev/null 2>&1 || as_verc_fail=yes
  rm -f $TMPS $TMPO $TMPC
  
***************
*** 901,905 ****
  system_name=`uname -s 2>&1`
  kernel_version=`uname -r 2>&1`
! echo -n "Checking $system_name kernel version ... "
  case $kernel_version in
      '') kernel_version="?.??"; _k_verc_fail=yes;;
--- 959,963 ----
  system_name=`uname -s 2>&1`
  kernel_version=`uname -r 2>&1`
! echo $_echo_n "Checking $system_name kernel version ... $_echo_c"
  case $kernel_version in
      '') kernel_version="?.??"; _k_verc_fail=yes;;
***************
*** 910,914 ****
  _k_verc_fail=yes
  fi
! if ! test -z "$_k_verc_fail"; then
  echo "$kernel_version, fail"
  echo "WARNING! You want to run mplayer on this system then be prepared for problems"
--- 968,972 ----
  _k_verc_fail=yes
  fi
! if [ ! -z "$_k_verc_fail" ]; then
  echo "$kernel_version, fail"
  echo "WARNING! You want to run mplayer on this system then be prepared for problems"
***************
*** 947,956 ****
  echo "Checking for SVGAlib ... $_svga"
  echo "Checking for FBDev ... $_fbdev"
  echo "Checking for DeCSS support ... $_css"
  echo "Checking for PNG support ... $_png"
  echo "Checking for DirectShow ... $_dshow"
  echo "Checking for fastmemcpy ... $_fastmemcpy"
- echo "Checking for alsa ... $_alsaver"
- echo "Checking for esd ... $_esd"
  # write conf files.
  
--- 1005,1016 ----
  echo "Checking for SVGAlib ... $_svga"
  echo "Checking for FBDev ... $_fbdev"
+ echo "Checking for OSS Audio ... $_oss_audio"
+ echo "Checking for ALSA Audio ... $_alsaver"
+ echo "Checking for ESD Audio ... $_esd"
+ echo "Checking for Sun Audio ... $_sun_audio"
  echo "Checking for DeCSS support ... $_css"
  echo "Checking for PNG support ... $_png"
  echo "Checking for DirectShow ... $_dshow"
  echo "Checking for fastmemcpy ... $_fastmemcpy"
  # write conf files.
  
***************
*** 1007,1010 ****
--- 1067,1071 ----
  if [ $_sdl = yes ]; then
    _sdllib=`$_sdlconfig --libs` 
+   _sdlcflags=`$_sdlconfig --cflags` 
  fi
  
***************
*** 1052,1062 ****
  _alsa5='#undef HAVE_ALSA5'
  _alsa9='#undef HAVE_ALSA9'
! if [ $_alsa == 'yes' ]; then
!  [ $_alsaver == '0.5.x' ] && { _aosrc="$_aosrc ao_alsa5.c"; _alsa5='#define HAVE_ALSA5'; _alsalib='-lasound'; }
!  # [ $_alsaver == '0.9.x' ] && { _aosrc="$_aosrc ao_alsa9.c"; _alsa9='#define HAVE_ALSA9'; _alsalib='-lasound'; }
  fi
    
  _esdd='#undef HAVE_ESD'
! #if [ $_esd == 'yes' ]; then
  # _esdd='#define HAVE_ESD'
  # _aosrc="$_aosrc ao_esd.c"
--- 1113,1123 ----
  _alsa5='#undef HAVE_ALSA5'
  _alsa9='#undef HAVE_ALSA9'
! if [ $_alsa = 'yes' ]; then
!  [ $_alsaver = '0.5.x' ] && { _aosrc="$_aosrc ao_alsa5.c"; _alsa5='#define HAVE_ALSA5'; _alsalib='-lasound'; }
!  # [ $_alsaver = '0.9.x' ] && { _aosrc="$_aosrc ao_alsa9.c"; _alsa9='#define HAVE_ALSA9'; _alsalib='-lasound'; }
  fi
    
  _esdd='#undef HAVE_ESD'
! #if [ $_esd = 'yes' ]; then
  # _esdd='#define HAVE_ESD'
  # _aosrc="$_aosrc ao_esd.c"
***************
*** 1064,1067 ****
--- 1125,1142 ----
  #fi
  
+ if [ "$_oss_audio" = "yes" ]; then
+  _ossaudio='#define USE_OSS_AUDIO'
+  _aosrc="$_aosrc ao_oss.c"
+ else
+  _ossaudio='#undef USE_OSS_AUDIO'
+ fi
+ 
+ if [ "$_sun_audio" = "yes" ]; then
+  _sunaudio='#define USE_SUN_AUDIO'
+  _aosrc="$_aosrc ao_sun.c"
+ else
+  _sunaudio='#undef USE_SUN_AUDIO'
+ fi
+ 
  # Checking for CFLAGS
  if [ "$_profile" != "" ] || [ "$_debug" != "" ]; then
***************
*** 1090,1093 ****
--- 1165,1170 ----
  CSS_LIB = $_csslib
  CSS_INC = $_cssinc
+ SDL_LIB = $_sdllib
+ SDL_INC = $_sdlcflags
  WIN32_PATH=-DWIN32_PATH=\"$_win32libdir\"
  DS_DEP = $_dshowdep
***************
*** 1288,1291 ****
--- 1365,1372 ----
     You can still change it runtime using -afm 1 (mpg123) or -afm 4 (l3codeca)*/
  $_mpg123
+ 
+ /* AUDIO Support */
+ $_ossaudio
+ $_sunaudio
  
  /* XMMP support: (test code) */

Index: dec_audio.c
===================================================================
RCS file: /cvsroot/mplayer/main/dec_audio.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** dec_audio.c	2001/06/05 02:26:55	1.15
--- dec_audio.c	2001/06/05 18:40:44	1.16
***************
*** 3,7 ****
  #include <stdlib.h>
  
! #ifdef __sun
  #include <sys/audioio.h>
  #define AFMT_MU_LAW     AUDIO_ENCODING_ULAW
--- 3,13 ----
  #include <stdlib.h>
  
! #include "config.h"
! 
! #ifdef	USE_OSS_AUDIO
! #include <sys/soundcard.h>
! #endif
! #ifdef	USE_SUN_AUDIO
! #include <sys/types.h>
  #include <sys/audioio.h>
  #define AFMT_MU_LAW     AUDIO_ENCODING_ULAW
***************
*** 10,19 ****
  #define AFMT_IMA_ADPCM  AUDIO_ENCODING_DVI
  #define AFMT_U8         AUDIO_ENCODING_LINEAR8
- #else
- #include <sys/soundcard.h>
  #endif
  
- #include "config.h"
- 
  extern int verbose; // defined in mplayer.c
  
--- 16,21 ----
***************
*** 41,44 ****
--- 43,47 ----
  #include "loader/DirectShow/DS_AudioDec.h"
  
+ 
  static sh_audio_t* ac3_audio_sh=NULL;
  
***************
*** 170,175 ****
      case 0x6:  sh_audio->sample_format=AFMT_A_LAW;break;
      case 0x7:  sh_audio->sample_format=AFMT_MU_LAW;break;
      case 0x11: sh_audio->sample_format=AFMT_IMA_ADPCM;break;
! #ifndef __sun
      case 0x50: sh_audio->sample_format=AFMT_MPEG;break;
  #endif
--- 173,180 ----
      case 0x6:  sh_audio->sample_format=AFMT_A_LAW;break;
      case 0x7:  sh_audio->sample_format=AFMT_MU_LAW;break;
+ #if !defined(__NetBSD__)
      case 0x11: sh_audio->sample_format=AFMT_IMA_ADPCM;break;
! #endif
! #if !defined(__sun) && !defined(__NetBSD__)
      case 0x50: sh_audio->sample_format=AFMT_MPEG;break;
  #endif

Index: mixer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mixer.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** mixer.c	2001/06/05 02:26:55	1.6
--- mixer.c	2001/06/05 18:40:44	1.7
***************
*** 2,24 ****
  #include <string.h>
  #include <sys/ioctl.h>
- #ifdef __sun
- #include <sys/audioio.h>
- #else
- #include <sys/soundcard.h>
- #endif
  #include <fcntl.h>
  #include <stdio.h>
  #include <unistd.h>
  
! #include "mixer.h"
  
! #ifdef __sun
! char * mixer_device="/dev/audioctl";
! #else
! char * mixer_device="/dev/mixer";
  #endif
  int    mixer_usemaster=0;
  
! void mixer_getvolume( int *l,int *r )
  {
   int fd,v,cmd,devs;
--- 2,27 ----
  #include <string.h>
  #include <sys/ioctl.h>
  #include <fcntl.h>
  #include <stdio.h>
  #include <unistd.h>
  
! #include "config.h"
  
! #ifdef USE_OSS_AUDIO
! #include <sys/soundcard.h>
  #endif
+ 
+ #ifdef USE_SUN_AUDIO
+ #include <sys/audioio.h>
+ #endif
+ 
+ #include "mixer.h"
+ 
+ #if	defined(USE_OSS_AUDIO)
+ 
+ char * mixer_device=DEV_MIXER;
  int    mixer_usemaster=0;
  
! void mixer_getvolume( float *l,float *r )
  {
   int fd,v,cmd,devs;
***************
*** 27,35 ****
   if ( fd != -1 )
    {
- #ifdef __sun
-    audio_info_t info;
-    ioctl( fd,AUDIO_GETINFO,&info );
-    *r=*l=(info.play.gain * 100 + (AUDIO_MAX_GAIN-1))/AUDIO_MAX_GAIN;
- #else
     ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs );
     if ( ( devs & SOUND_MASK_PCM ) && ( mixer_usemaster==0 ) ) cmd=SOUND_MIXER_READ_PCM;
--- 30,33 ----
***************
*** 44,53 ****
     *r=( v & 0xFF00 ) >> 8;
     *l=( v & 0x00FF );
- #endif
     close( fd );
    }
  }
  
! void mixer_setvolume( int l,int r )
  {
   int fd,v,cmd,devs;
--- 42,50 ----
     *r=( v & 0xFF00 ) >> 8;
     *l=( v & 0x00FF );
     close( fd );
    }
  }
  
! void mixer_setvolume( float l,float r )
  {
   int fd,v,cmd,devs;
***************
*** 56,65 ****
   if ( fd != -1 )
    {
- #ifdef __sun
-    audio_info_t info;
-    ioctl( fd,AUDIO_GETINFO,&info );
-    info.play.gain = ((l+r)*AUDIO_MAX_GAIN+199)/200;
-    ioctl( fd,AUDIO_SETINFO,&info );
- #else
     ioctl( fd,SOUND_MIXER_READ_DEVMASK,&devs );
     if ( ( devs & SOUND_MASK_PCM ) && ( mixer_usemaster==0 ) ) cmd=SOUND_MIXER_WRITE_PCM;
--- 53,56 ----
***************
*** 71,88 ****
              return;
             }
!    v=( r << 8 ) | l;
     ioctl( fd,cmd,&v );
- #endif
     close( fd );
    }
  }
  
- int mixer_l=0; int mixer_r=0;
  
  void mixer_incvolume( void )
  {
   mixer_getvolume( &mixer_l,&mixer_r );
!  if ( mixer_l < 100 ) mixer_l++;
!  if ( mixer_r < 100 ) mixer_r++;
   mixer_setvolume( mixer_l,mixer_r );
  }
--- 62,116 ----
              return;
             }
!    v=( (int)r << 8 ) | (int)l;
     ioctl( fd,cmd,&v );
     close( fd );
    }
  }
+ #elif	defined(USE_SUN_AUDIO)
+ 
+ char * mixer_device="/dev/audioctl";
+ int    mixer_usemaster=0;
+ 
+ void mixer_getvolume( float *l,float *r )
+ {
+  int fd,v,cmd,devs;
+ 
+  fd=open( mixer_device,O_RDONLY );
+  if ( fd != -1 )
+   {
+    struct audio_info info;
+ 
+    ioctl( fd,AUDIO_GETINFO,&info);
+    *r=info.play.gain * 100. / AUDIO_MAX_GAIN;
+    *l=info.play.gain * 100. / AUDIO_MAX_GAIN;
+    close( fd );
+   }
+ }
+ 
+ void mixer_setvolume( float l,float r )
+ {
+  int fd,v,cmd,devs;
+ 
+  fd=open( mixer_device,O_RDONLY );
+  if ( fd != -1 )
+   {
+    struct audio_info info;
+    AUDIO_INITINFO(&info);
+    info.play.gain = (r+l) * AUDIO_MAX_GAIN / 100 / 2;
+    ioctl( fd,AUDIO_SETINFO,&info );
+    close( fd );
+   }
+ }
+ #endif
  
  
  void mixer_incvolume( void )
  {
+  float mixer_l, mixer_r;
   mixer_getvolume( &mixer_l,&mixer_r );
!  mixer_l++;
!  if ( mixer_l > 100 ) mixer_l = 100;
!  mixer_r++;
!  if ( mixer_r > 100 ) mixer_r = 100;
   mixer_setvolume( mixer_l,mixer_r );
  }
***************
*** 90,101 ****
  void mixer_decvolume( void )
  {
   mixer_getvolume( &mixer_l,&mixer_r );
!  if ( mixer_l > 0 ) mixer_l--;
!  if ( mixer_r > 0 ) mixer_r--;
   mixer_setvolume( mixer_l,mixer_r );
  }
  
! int mixer_getbothvolume( void )
  {
   mixer_getvolume( &mixer_l,&mixer_r );
   return ( mixer_l + mixer_r ) / 2;
--- 118,133 ----
  void mixer_decvolume( void )
  {
+  float mixer_l, mixer_r;
   mixer_getvolume( &mixer_l,&mixer_r );
!  mixer_l--;
!  if ( mixer_l < 0 ) mixer_l = 0;
!  mixer_r--;
!  if ( mixer_r < 0 ) mixer_r = 0;
   mixer_setvolume( mixer_l,mixer_r );
  }
  
! float mixer_getbothvolume( void )
  {
+  float mixer_l, mixer_r;
   mixer_getvolume( &mixer_l,&mixer_r );
   return ( mixer_l + mixer_r ) / 2;

Index: mixer.h
===================================================================
RCS file: /cvsroot/mplayer/main/mixer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** mixer.h	2001/04/15 18:37:07	1.1
--- mixer.h	2001/06/05 18:40:44	1.2
***************
*** 8,19 ****
  extern char * mixer_device;
  
! extern void mixer_getvolume( int *l,int *r );
! extern void mixer_setvolume( int l,int r );
  extern void mixer_incvolume( void );
  extern void mixer_decvolume( void );
! extern int  mixer_getbothvolume( void );
  
  //extern void mixer_setbothvolume( int v );
  #define mixer_setbothvolume( v ) mixer_setvolume( v,v )
  
! #endif
\ No newline at end of file
--- 8,19 ----
  extern char * mixer_device;
  
! extern void mixer_getvolume( float *l,float *r );
! extern void mixer_setvolume( float l,float r );
  extern void mixer_incvolume( void );
  extern void mixer_decvolume( void );
! extern float mixer_getbothvolume( void );
  
  //extern void mixer_setbothvolume( int v );
  #define mixer_setbothvolume( v ) mixer_setvolume( v,v )
  
! #endif

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.153
retrieving revision 1.154
diff -C2 -r1.153 -r1.154
*** mplayer.c	2001/06/05 08:42:16	1.153
--- mplayer.c	2001/06/05 18:40:44	1.154
***************
*** 17,29 ****
  #include <sys/stat.h>
  #include <fcntl.h>
- #ifdef __sun
- #include <sys/audioio.h>
- #else
- #include <sys/soundcard.h>
- #endif
  
  #include "version.h"
  #include "config.h"
  
  #ifndef MAX_OUTBURST
  #error "============================================="
--- 17,36 ----
  #include <sys/stat.h>
  #include <fcntl.h>
  
  #include "version.h"
  #include "config.h"
  
+ #if defined(USE_OSS_AUDIO)
+ #include <sys/soundcard.h>
+ #elif defined(USE_SUN_AUDIO)
+ #endif
+ 
+ #if	defined(sun)
+ #define	DEFAULT_CDROM_DEVICE	"/vol/dev/aliases/cdrom0"
+ #else
+ #define	DEFAULT_CDROM_DEVICE	"/dev/cdrom"
+ #endif
+ 
+ 
  #ifndef MAX_OUTBURST
  #error "============================================="
***************
*** 66,69 ****
--- 73,80 ----
  //extern int vo_screenwidth;
  
+ int audio_fd=-1;
+ 
+ extern int vo_screenwidth;
+ 
  extern char* win32_codec_name;  // must be set before calling DrvOpen() !!!
  
***************
*** 87,90 ****
--- 98,102 ----
  #endif
  
+ 
  #define DEBUG if(0)
  #ifdef HAVE_GUI
***************
*** 98,101 ****
--- 110,126 ----
  void find_sub(subtitle* subtitles,int key);
  
+ static int
+ usec_sleep(int usec_delay)
+ {
+ #if	1
+     struct timespec ts;
+     ts.tv_sec  =  usec_delay / 1000000;
+     ts.tv_nsec = (usec_delay % 1000000) * 1000;
+     return nanosleep(&ts, NULL);
+ #else
+     return usleep(usec_delay);
+ #endif
+ }
+ 
  //**************************************************************************//
  //             Config file
***************
*** 270,274 ****
  #ifdef HAVE_GUI
   #include "../Gui/mplayer/psignal.h"
!  #define GUI_MSG(x) if ( !nogui ) { mplSendMessage( x ); usleep( 10000 ); }
  #else
   #define GUI_MSG(x)
--- 295,299 ----
  #ifdef HAVE_GUI
   #include "../Gui/mplayer/psignal.h"
!  #define GUI_MSG(x) if ( !nogui ) { mplSendMessage( x ); usec_sleep( 10000 ); }
  #else
   #define GUI_MSG(x)
***************
*** 298,301 ****
--- 323,328 ----
       getch2_disable();
    video_out->uninit();
+   audio_out->reset();
+   audio_out->uninit();
    if(encode_name) avi_fixate();
  #ifdef HAVE_LIRC
***************
*** 404,407 ****
--- 431,436 ----
  char *dsp=NULL;
  
+ float rel_seek_secs=0;
+ 
  #include "mixer.h"
  #include "cfg-mplayer.h"
***************
*** 506,514 ****
  
  if(!filename){
! #ifdef __sun
!   if(vcd_track) filename="/vol/dev/aliases/cdrom0"; 
! #else
!   if(vcd_track) filename="/dev/cdrom"; 
! #endif
    else {
      printf("%s",help_text); exit(0);
--- 535,539 ----
  
  if(!filename){
!   if(vcd_track) filename=DEFAULT_CDROM_DEVICE;
    else {
      printf("%s",help_text); exit(0);
***************
*** 643,646 ****
--- 668,672 ----
    if (dvd_auth_device) {
      if (dvd_auth(dvd_auth_device,f)) {
+ //    if (dvd_auth(dvd_auth_device,filename)) {
          GUI_MSG( mplErrorDVDAuth )
          exit(0);
***************
*** 1074,1078 ****
         mplShMem->items.videodata.format=sh_video->format;
         mplSendMessage( mplCantFindCodecForVideoFormat );
!        usleep( 10000 );
        }
      #endif
--- 1100,1104 ----
         mplShMem->items.videodata.format=sh_video->format;
         mplSendMessage( mplCantFindCodecForVideoFormat );
!        usec_sleep( 10000 );
        }
      #endif
***************
*** 1138,1142 ****
             strcpy(  mplShMem->items.videodata.codecdll,sh_video->codec->dll );
             mplSendMessage( mplDSCodecNotFound );
!            usleep( 10000 );
            }
          #endif
--- 1164,1168 ----
             strcpy(  mplShMem->items.videodata.codecdll,sh_video->codec->dll );
             mplSendMessage( mplDSCodecNotFound );
!            usec_sleep( 10000 );
            }
          #endif
***************
*** 1509,1517 ****
      } else {
          while(time_frame>0.022){
!             usleep(time_frame-0.022);
              time_frame-=GetRelativeTime();
          }
          while(time_frame>0.007){
!             usleep(0);
              time_frame-=GetRelativeTime();
          }
--- 1535,1543 ----
      } else {
          while(time_frame>0.022){
!             usec_sleep(time_frame-0.022);
              time_frame-=GetRelativeTime();
          }
          while(time_frame>0.007){
!             usec_sleep(1000);	// sleeps 1 clock tick (10ms)!
              time_frame-=GetRelativeTime();
          }
***************
*** 1745,1749 ****
            time_frame=v_frame;
            time_frame-=a_frame-(float)delay/(float)sh_audio->o_bps;
! 	  if(time_frame>-2*frame_time) drop_frame=0; // stop dropping frames
        }
  
--- 1771,1782 ----
            time_frame=v_frame;
            time_frame-=a_frame-(float)delay/(float)sh_audio->o_bps;
! 	  if(time_frame>-2*frame_time) {
! 	    drop_frame=0; // stop dropping frames
! 	    if (verbose>0) printf("\nstop frame drop %.2f\n", time_frame);
! 	  }else{
! 	    ++drop_frame_cnt;
! 	    if (verbose > 0 && drop_frame_cnt%10 == 0)
! 	      printf("\nstill dropping, %.2f\n", time_frame);
! 	  }
        }
  
***************
*** 1763,1766 ****
--- 1796,1800 ----
  	      drop_frame=frame_dropping; // tricky!
  	      ++drop_frame_cnt;
+ 	      if (verbose>0) printf("\nframe drop %d, %.2f\n", drop_frame, time_frame);
  	  }
        } else {
***************
*** 1772,1778 ****
        while(time_frame>0.005){
            if(time_frame<=0.020)
!              usleep(0); // sleep 10ms
            else
!              usleep(1000000*(time_frame-0.002));
            time_frame-=GetRelativeTime();
        }
--- 1806,1812 ----
        while(time_frame>0.005){
            if(time_frame<=0.020)
!              usec_sleep(10000); // sleeps 1 clock tick (10ms)!
            else
!              usec_sleep(1000000*(time_frame-0.002));
            time_frame-=GetRelativeTime();
        }
***************
*** 1780,1784 ****
          current_module="flip_page";
          video_out->flip_page();
! //        usleep(50000); // test only!
  
      }
--- 1814,1818 ----
          current_module="flip_page";
          video_out->flip_page();
! //        usec_sleep(50000); // test only!
  
      }
***************
*** 1846,1850 ****
            max_pts_correction=sh_video->frametime*0.10; // +-10% of time
          a_frame+=x; c_total+=x;
!         printf(" ct:%7.3f  %3d  %2d%% %2d%% %3.1f%% %d\r",c_total,
          (int)num_frames,
          (v_frame>0.5)?(int)(100.0*video_time_usage/(double)v_frame):0,
--- 1880,1884 ----
            max_pts_correction=sh_video->frametime*0.10; // +-10% of time
          a_frame+=x; c_total+=x;
!         printf(" ct:%7.3f  %3d  %2d%% %2d%% %4.1f%% %d\r",c_total,
          (int)num_frames,
          (v_frame>0.5)?(int)(100.0*video_time_usage/(double)v_frame):0,
***************
*** 1887,1891 ****
    if(osd_function==OSD_PAUSE){
        printf("\n------ PAUSED -------\r");fflush(stdout);
!       audio_out->reset(); // stop audio
  #ifdef HAVE_GUI
        if ( nogui )
--- 1921,1925 ----
    if(osd_function==OSD_PAUSE){
        printf("\n------ PAUSED -------\r");fflush(stdout);
!       audio_out->pause();	// pause audio, keep data if possible
  #ifdef HAVE_GUI
        if ( nogui )
***************
*** 1898,1907 ****
               (!f || getch2(20)<=0) && mplayer_get_key()<=0){
  	     video_out->check_events();
!              if(!f) usleep(1000); // do not eat the CPU
           }
           osd_function=OSD_PLAY;
  #ifdef HAVE_GUI
!         } else while( osd_function != OSD_PLAY ) usleep( 1000 );
  #endif
    }
  
--- 1932,1942 ----
               (!f || getch2(20)<=0) && mplayer_get_key()<=0){
  	     video_out->check_events();
!              if(!f) usec_sleep(1000); // do not eat the CPU
           }
           osd_function=OSD_PLAY;
  #ifdef HAVE_GUI
!         } else while( osd_function != OSD_PLAY ) usec_sleep( 1000 );
  #endif
+       audio_out->resume();	// resume audio
    }
  
***************
*** 1968,1979 ****
      case '*':
      case '/': {
!         int mixer_l=0; int mixer_r=0;
          mixer_getvolume( &mixer_l,&mixer_r );
          if(c=='*'){
!             if ( mixer_l < 100 ) mixer_l++;
!             if ( mixer_r < 100 ) mixer_r++;
          } else {
!             if ( mixer_l > 0 ) mixer_l--;
!             if ( mixer_r > 0 ) mixer_r--;
          }
          mixer_setvolume( mixer_l,mixer_r );
--- 2003,2014 ----
      case '*':
      case '/': {
!         float mixer_l, mixer_r;
          mixer_getvolume( &mixer_l,&mixer_r );
          if(c=='*'){
!             mixer_l++; if ( mixer_l > 100 ) mixer_l = 100;
!             mixer_r++; if ( mixer_r > 100 ) mixer_r = 100;
          } else {
!             mixer_l--; if ( mixer_l < 0 ) mixer_l = 0;
!             mixer_r--; if ( mixer_r < 0 ) mixer_r = 0;
          }
          mixer_setvolume( mixer_l,mixer_r );
***************
*** 2259,2263 ****
          current_module=NULL;
  
!         audio_out->reset(); // stop audio
  
          c_total=0; // kell ez?
--- 2294,2298 ----
          current_module=NULL;
  
!         audio_out->reset(); // stop audio, throwing away buffered data
  
          c_total=0; // kell ez?

Index: stream.c
===================================================================
RCS file: /cvsroot/mplayer/main/stream.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** stream.c	2001/06/05 02:26:56	1.9
--- stream.c	2001/06/05 18:40:44	1.10
***************
*** 6,24 ****
  #include <unistd.h>
  
- //#include <sys/types.h>
- //#include <sys/stat.h>
- //#include <fcntl.h>
- 
- #ifdef __FreeBSD__
- #include <sys/cdio.h>
- #include <sys/cdrio.h>
- #else
- #ifdef __sun
- #include <sys/cdio.h>
- #else
- #include <linux/cdrom.h>
- #endif
- #endif
- 
  #include "stream.h"
  
--- 6,9 ----

Index: vcd_read.c
===================================================================
RCS file: /cvsroot/mplayer/main/vcd_read.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** vcd_read.c	2001/06/05 02:26:56	1.4
--- vcd_read.c	2001/06/05 18:40:44	1.5
***************
*** 1,3 ****
--- 1,13 ----
  //=================== VideoCD ==========================
+ #if	defined(linux) || defined(sun)
+ 
+ #if	defined(linux)
+ #include <linux/cdrom.h>
+ #elif	defined(sun)
+ #include <sys/cdio.h>
+ static int sun_vcd_read(int, int*);
+ #endif
+ 
+ 
  static struct cdrom_tocentry vcd_entry;
  
***************
*** 66,97 ****
  }
  
  static char vcd_buf[VCD_SECTOR_SIZE];
  
  static int vcd_read(int fd,char *mem){
! #ifdef __sun
!       struct cdrom_cdxa xa;
!       xa.cdxa_addr = vcd_get_msf();
!       xa.cdxa_length = CDROM_BLK_2352;
!       xa.cdxa_data = vcd_buf;
!       xa.cdxa_format = CDROM_XA_SECTOR_DATA;
!       if(ioctl(fd,CDROMCDXA,&xa)==-1) return 0; // EOF?
! #else
!       memcpy(vcd_buf,&vcd_entry.cdte_addr.msf,sizeof(struct cdrom_msf));
!       if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; // EOF?
  #endif
  
-       vcd_entry.cdte_addr.msf.frame++;
-       if (vcd_entry.cdte_addr.msf.frame==75){
-         vcd_entry.cdte_addr.msf.frame=0;
-         vcd_entry.cdte_addr.msf.second++;
-         if (vcd_entry.cdte_addr.msf.second==60){
-           vcd_entry.cdte_addr.msf.second=0;
-           vcd_entry.cdte_addr.msf.minute++;
-         }
-       }
  
!       memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
!       return VCD_SECTOR_DATA;
  }
  
  //================== VCD CACHE =======================
--- 76,201 ----
  }
  
+ 
  static char vcd_buf[VCD_SECTOR_SIZE];
  
  static int vcd_read(int fd,char *mem){
! #if	defined(linux)
!   memcpy(vcd_buf,&vcd_entry.cdte_addr.msf,sizeof(struct cdrom_msf));
!   if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; // EOF?
!   memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
! #elif	defined(sun)
!   {
!     int offset;
!     if (sun_vcd_read(fd, &offset) <= 0) return 0;
!     memcpy(mem,&vcd_buf[offset],VCD_SECTOR_DATA);
!   }
  #endif
+ 
+   vcd_entry.cdte_addr.msf.frame++;
+   if (vcd_entry.cdte_addr.msf.frame==75){
+     vcd_entry.cdte_addr.msf.frame=0;
+     vcd_entry.cdte_addr.msf.second++;
+     if (vcd_entry.cdte_addr.msf.second==60){
+       vcd_entry.cdte_addr.msf.second=0;
+       vcd_entry.cdte_addr.msf.minute++;
+     }
+   }
+     
+   return VCD_SECTOR_DATA;
+ }
  
  
! #ifdef	sun
! #include <sys/scsi/generic/commands.h>
! #include <sys/scsi/impl/uscsi.h>
! 
! #define	SUN_XAREAD	1	/*fails on atapi drives*/
! #define	SUN_MODE2READ	2	/*fails on atapi drives*/
! #define	SUN_SCSIREAD	3
! #define	SUN_VCDREAD	SUN_SCSIREAD
! 
! static int sun_vcd_read(int fd, int *offset)
! {
! #if SUN_VCDREAD == SUN_XAREAD
!   struct cdrom_cdxa cdxa;
!   cdxa.cdxa_addr = vcd_get_msf();
!   cdxa.cdxa_length = 1;
!   cdxa.cdxa_data = vcd_buf;
!   cdxa.cdxa_format = CDROM_XA_SECTOR_DATA;
!   
!   if(ioctl(fd,CDROMCDXA,&cdxa)==-1) {
!     perror("CDROMCDXA");
!     return 0;
!   }
!   *offset = 0;
! #elif SUN_VCDREAD == SUN_MODE2READ
!   struct cdrom_read cdread;
!   cdread.cdread_lba = 4*vcd_get_msf();
!   cdread.cdread_bufaddr = vcd_buf;
!   cdread.cdread_buflen = 2336;
! 
!   if(ioctl(fd,CDROMREADMODE2,&cdread)==-1) {
!     perror("CDROMREADMODE2");
!     return 0;
!   }
!   *offset = 8;
! #elif SUN_VCDREAD == SUN_SCSIREAD
!   struct uscsi_cmd sc;
!   union scsi_cdb cdb;
!   int lba = vcd_get_msf();
!   int blocks = 1;
!   int sector_type;
!   int sync, header_code, user_data, edc_ecc, error_field;
!   int sub_channel;
! 
!   /* sector_type = 3;	/* mode2 */
!   sector_type = 5;	/* mode2/form2 */
!   sync = 0;
!   header_code = 0;
!   user_data = 1;
!   edc_ecc = 0;
!   error_field = 0;
!   sub_channel = 0;
! 
!   memset(&cdb, 0, sizeof(cdb));
!   memset(&sc, 0, sizeof(sc));
!   cdb.scc_cmd = 0xBE;
!   cdb.cdb_opaque[1] = (sector_type) << 2;
!   cdb.cdb_opaque[2] = (lba >> 24) & 0xff;
!   cdb.cdb_opaque[3] = (lba >> 16) & 0xff;
!   cdb.cdb_opaque[4] = (lba >>  8) & 0xff;
!   cdb.cdb_opaque[5] =  lba & 0xff;
!   cdb.cdb_opaque[6] = (blocks >> 16) & 0xff;
!   cdb.cdb_opaque[7] = (blocks >>  8) & 0xff;
!   cdb.cdb_opaque[8] =  blocks & 0xff;
!   cdb.cdb_opaque[9] = (sync << 7) |
! 		      (header_code << 5) |
! 		      (user_data << 4) |
! 		      (edc_ecc << 3) |
! 		      (error_field << 1);
!   cdb.cdb_opaque[10] = sub_channel;
! 
!   sc.uscsi_cdb = &cdb;
!   sc.uscsi_cdblen = 12;
!   sc.uscsi_bufaddr = vcd_buf;
!   sc.uscsi_buflen = 2336;
!   sc.uscsi_flags = USCSI_ISOLATE | USCSI_READ;
!   sc.uscsi_timeout = 20;
!   if (ioctl(fd, USCSICMD, &sc)) {
!       perror("USCSICMD: READ CD");
!       return -1;
!   }
!   if (sc.uscsi_status) {
!       fprintf(stderr, "scsi command failed with status %d\n", sc.uscsi_status);
!       return -1;
!   }
!   *offset = 0;
!   return 1;
! #else
! #error SUN_VCDREAD
! #endif
  }
+ #endif	/*sun*/
+ 
  
  //================== VCD CACHE =======================
***************
*** 116,121 ****
  
  int vcd_cache_read(int fd,char* mem){
! int i;
! char* vcd_buf;
    for(i=0;i<vcd_cache_size;i++)
      if(vcd_cache_sectors[i]==vcd_cache_current){
--- 220,226 ----
  
  int vcd_cache_read(int fd,char* mem){
!   int i;
!   char* vcd_buf;
! 
    for(i=0;i<vcd_cache_size;i++)
      if(vcd_cache_sectors[i]==vcd_cache_current){
***************
*** 132,141 ****
    // read data!
    vcd_set_msf(vcd_cache_current);
    memcpy(vcd_buf,&vcd_entry.cdte_addr.msf,sizeof(struct cdrom_msf));
    if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; // EOF?
-   ++vcd_cache_current;
    memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
    return VCD_SECTOR_DATA;
  }
- 
  #endif
--- 237,278 ----
    // read data!
    vcd_set_msf(vcd_cache_current);
+ #if	defined(linux)
    memcpy(vcd_buf,&vcd_entry.cdte_addr.msf,sizeof(struct cdrom_msf));
    if(ioctl(fd,CDROMREADRAW,vcd_buf)==-1) return 0; // EOF?
    memcpy(mem,&vcd_buf[VCD_SECTOR_OFFS],VCD_SECTOR_DATA);
+ #elif	defined(sun)
+   {
+     int offset;
+     if (sun_vcd_read(fd, &offset) <= 0) return 0;
+     memcpy(mem,&vcd_buf[offset],VCD_SECTOR_DATA);
+   }
+ #endif
+   ++vcd_cache_current;
    return VCD_SECTOR_DATA;
  }
  #endif
+ 
+ #else /* linux || sun */
+ 
+ int vcd_seek_to_track(int fd,int track)
+ {
+   return -1;
+ }
+ 
+ int vcd_get_track_end(int fd,int track)
+ {
+   return -1;
+ }
+ 
+ void vcd_read_toc(int fd)
+ {
+ }
+ 
+ static char vcd_buf[VCD_SECTOR_SIZE];
+ 
+ static int vcd_read(int fd,char *mem)
+ {
+   return -1;
+ }
+ 
+ #endif /* !linux && !sun */

Index: vcd_read_fbsd.c
===================================================================
RCS file: /cvsroot/mplayer/main/vcd_read_fbsd.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** vcd_read_fbsd.c	2001/06/03 00:31:41	1.1
--- vcd_read_fbsd.c	2001/06/05 18:40:44	1.2
***************
*** 1,2 ****
--- 1,5 ----
+ #include <sys/cdio.h>
+ #include <sys/cdrio.h>
+ 
  //=================== VideoCD ==========================
  #define	CDROM_LEADOUT	0xAA

Index: version.sh
===================================================================
RCS file: /cvsroot/mplayer/main/version.sh,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** version.sh	2001/04/30 02:25:07	1.2
--- version.sh	2001/06/05 18:40:44	1.3
***************
*** 1,4 ****
  #!/bin/sh
  
! echo "#define VERSION \"0.17cvs-"`date -r CVS/Entries +%y%m%d-%H:%M`"\"" >version.h
! 
--- 1,8 ----
  #!/bin/sh
  
! last_cvs_update=`date -r CVS/Entries +%y%m%d-%H:%M 2>/dev/null`
! if [ $? -ne 0 ]; then
! 	# probably no gnu date installed(?), use current date
! 	last_cvs_update=`date +%y%m%d-%H:%M`
! fi
! echo "#define VERSION \"0.17cvs-${last_cvs_update}\"" >version.h


_______________________________________________
Mplayer-cvslog mailing list
Mplayer-cvslog at lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/mplayer-cvslog



More information about the MPlayer-cvslog mailing list