Index: Makefile =================================================================== RCS file: /cvsroot/mplayer/main/Makefile,v retrieving revision 1.322 diff -u -r1.322 Makefile --- Makefile 7 May 2005 14:50:14 -0000 1.322 +++ Makefile 10 May 2005 08:46:48 -0000 @@ -32,7 +32,7 @@ VO_LIBS = $(AA_LIB) $(X_LIB) $(SDL_LIB) $(GGI_LIB) $(MP1E_LIB) $(MLIB_LIB) $(SVGA_LIB) $(DIRECTFB_LIB) $(CACA_LIB) AO_LIBS = $(ARTS_LIB) $(ESD_LIB) $(JACK_LIB) $(NAS_LIB) $(SGIAUDIO_LIB) $(POLYP_LIB) -CODEC_LIBS = $(AV_LIB) $(FAME_LIB) $(MAD_LIB) $(VORBIS_LIB) $(THEORA_LIB) $(FAAD_LIB) $(LIBLZO_LIB) $(DECORE_LIB) $(XVID_LIB) $(DTS_LIB) $(PNG_LIB) $(Z_LIB) $(JPEG_LIB) $(ALSA_LIB) $(XMMS_LIB) $(X264_LIB) +CODEC_LIBS = $(AV_LIB) $(FAME_LIB) $(MAD_LIB) $(VORBIS_LIB) $(THEORA_LIB) $(FAAD_LIB) $(LIBLZO_LIB) $(DECORE_LIB) $(XVID_LIB) $(DTS_LIB) $(PNG_LIB) $(Z_LIB) $(JPEG_LIB) $(ALSA_LIB) $(XMMS_LIB) $(X264_LIB) $(MUSEPACK_LIB) COMMON_LIBS = libmpcodecs/libmpcodecs.a $(W32_LIB) $(DS_LIB) libaf/libaf.a libmpdemux/libmpdemux.a input/libinput.a postproc/libswscale.a osdep/libosdep.a $(DVDREAD_LIB) $(CODEC_LIBS) $(FREETYPE_LIB) $(TERMCAP_LIB) $(CDPARANOIA_LIB) $(MPLAYER_NETWORK_LIB) $(WIN32_LIB) $(GIF_LIB) $(MACOSX_FRAMEWORKS) $(SMBSUPPORT_LIB) $(FRIBIDI_LIB) $(FONTCONFIG_LIB) $(ENCA_LIB) CFLAGS = $(OPTFLAGS) -I. $(FREETYPE_INC) $(EXTRA_INC) $(CDPARANOIA_INC) $(SDL_INC) $(X11_INC) $(FRIBIDI_INC) $(DVB_INC) $(XVID_INC) $(FONTCONFIG_INC) $(CACA_INC) # -Wall Index: configure =================================================================== RCS file: /cvsroot/mplayer/main/configure,v retrieving revision 1.1000 diff -u -r1.1000 configure --- configure 10 May 2005 00:57:43 -0000 1.1000 +++ configure 10 May 2005 08:46:48 -0000 @@ -232,6 +232,7 @@ --disable-liba52 disable builtin liba52 [enabled] --enable-libdts enable libdts support [autodetect] --disable-libmpeg2 disable builtin libmpeg2 [enabled] + --disable-musepack disable musepack support [autodetect] --disable-amr_nb disable amr narrowband, floating point [autodetect] --disable-amr_nb-fixed disable amr narrowband, fixed point [autodetect] --disable-amr_wb disable amr wideband, floating point [autodetect] @@ -1423,6 +1424,7 @@ _inet6=auto _gethostbyname2=auto _ftp=yes +_musepack=auto _vstream=auto for ac_option do case "$ac_option" in @@ -1539,6 +1541,8 @@ --disable-libdts) _libdts=no ;; --enable-libmpeg2) _libmpeg2=yes ;; --disable-libmpeg2) _libmpeg2=no ;; + --enable-musepack) _musepack=yes ;; + --disable-musepack) _musepack=no ;; --enable-internal-matroska) _matroska_internal=yes ;; --disable-internal-matroska) _matroska_internal=no ;; --enable-internal-faad) _faad_internal=yes _faad_external=no ;; @@ -5375,6 +5379,25 @@ fi echores "$_libmpeg2" +echocheck "musepack support" +if test "$_musepack" = auto ; then + _musepack=no + cat > $TMPC << EOF +#include +int main(void) { mpc_streaminfo info; mpc_streaminfo_init(&info); return 0; } +EOF + cc_check -lmpcdec $_ld_lm && _musepack=yes +fi +if test "$_musepack" = yes ; then + _def_musepack='#define HAVE_MUSEPACK 1' + _ld_musepack='-lmpcdec' + _codecmodules="musepack $_codecmodules" +else + _def_musepack='#undef HAVE_MUSEPACK' + _nocodecmodules="musepack $_nocodecmodules" +fi +echores "$_musepack" + echocheck "Matroska support" if test "$_matroska_internal" = yes ; then @@ -6826,6 +6860,8 @@ TREMOR = $_tremor_internal TREMOR_FLAGS = $_tremor_flags +MUSEPACK = $_musepack + UNRARLIB = $_unrarlib HAVE_FFPOSTPROCESS = $_def_haveffpostprocess PNG = $_mkf_png @@ -6946,6 +6982,7 @@ TOOLAME_LIB=$_toolame_lib TWOLAME=$_twolame TWOLAME_LIB=$_twolame_lib +MUSEPACK_LIB = $_ld_musepack FAAC=$_faac FAAC_LIB=$_ld_faac AMR_NB=$_amr_nb @@ -7486,6 +7523,9 @@ /* enable Tremor as vorbis decoder */ $_def_tremor +/* enable musepack support */ +$_def_musepack + /* enable OggTheora support */ $_def_theora Index: etc/codecs.conf =================================================================== RCS file: /cvsroot/mplayer/main/etc/codecs.conf,v retrieving revision 1.411 diff -u -r1.411 codecs.conf --- etc/codecs.conf 4 May 2005 20:35:21 -0000 1.411 +++ etc/codecs.conf 10 May 2005 08:46:49 -0000 @@ -2446,6 +2446,12 @@ driver ffmpeg dll "dts" +audiocodec musepack + info "MPC/MpegPlus audio codec" + status working + fourcc "MPC " + driver libmusepack + audiocodec ffamrnb info "AMR Narrowband" status working Index: libmpcodecs/Makefile =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v retrieving revision 1.141 diff -u -r1.141 Makefile --- libmpcodecs/Makefile 7 May 2005 14:49:18 -0000 1.141 +++ libmpcodecs/Makefile 10 May 2005 08:46:49 -0000 @@ -56,6 +56,10 @@ ENCODER_SRCS += ae_lavc.c endif +ifeq ($(MUSEPACK),yes) +AUDIO_SRCS += ad_mpc.c +endif + ifeq ($(FAAC),yes) ENCODER_SRCS += ae_faac.c endif Index: libmpcodecs/ad.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/ad.c,v retrieving revision 1.20 diff -u -r1.20 ad.c --- libmpcodecs/ad.c 29 Dec 2004 19:51:56 -0000 1.20 +++ libmpcodecs/ad.c 10 May 2005 08:46:49 -0000 @@ -39,6 +39,7 @@ extern ad_functions_t mpcodecs_ad_qtaudio; extern ad_functions_t mpcodecs_ad_ra1428; extern ad_functions_t mpcodecs_ad_twin; +extern ad_functions_t mpcodecs_ad_libmusepack; ad_functions_t* mpcodecs_ad_drivers[] = { @@ -87,5 +88,8 @@ &mpcodecs_ad_libdv, #endif &mpcodecs_ad_ra1428, +#ifdef HAVE_MUSEPACK + &mpcodecs_ad_libmusepack, +#endif NULL }; Index: libmpdemux/demux_audio.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpdemux/demux_audio.c,v retrieving revision 1.35 diff -u -r1.35 demux_audio.c --- libmpdemux/demux_audio.c 18 Apr 2005 20:51:34 -0000 1.35 +++ libmpdemux/demux_audio.c 10 May 2005 08:46:49 -0000 @@ -18,6 +18,7 @@ #define MP3 1 #define WAV 2 #define fLaC 3 +#define MPC 4 #define HDR_SIZE 4 @@ -157,6 +158,9 @@ len = (hdr[0]<<21) | (hdr[1]<<14) | (hdr[2]<<7) | hdr[3]; stream_skip(s,len); step = 4; + } else if( hdr[0] == 'M' && hdr[1] == 'P' && hdr[2] == '+') { + frmt = MPC; + break; } else if( hdr[0] == 'f' && hdr[1] == 'm' && hdr[2] == 't' && hdr[3] == ' ' ) { frmt = WAV; break; @@ -238,6 +242,20 @@ } } break; + case MPC: { + char *wf = (char *)calloc(1, sizeof(WAVEFORMATEX) + 6 * 4); + char *header = &wf[sizeof(WAVEFORMATEX)]; + sh_audio->format = mmioFOURCC('M', 'P', 'C', ' '); + memcpy(header, hdr, 4); + stream_read(s, &header[4], 5 * 4); + sh_audio->wf = (WAVEFORMATEX *)wf; + sh_audio->wf->wFormatTag = sh_audio->format; + sh_audio->wf->nAvgBytesPerSec = 100; // dummy to make mencoder not hang + sh_audio->wf->cbSize = 6 * 4; + demuxer->movi_start = stream_tell(s); + demuxer->movi_end = s->end_pos; + } + break; case WAV: { unsigned int chunk_type; unsigned int chunk_size; @@ -411,6 +429,7 @@ priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + l/(float)sh_audio->i_bps; break; } + case MPC: case fLaC: { l = 65535; dp = new_demux_packet(l); @@ -462,6 +481,9 @@ s = demuxer->stream; priv = demuxer->priv; + if (priv->frmt == MPC) + return; + if(priv->frmt == MP3 && hr_mp3_seek && !(flags & 2)) { len = (flags & 1) ? rel_seek_secs - priv->last_pts : rel_seek_secs; if(len < 0) {