0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

replace mp3lame version detection by required features detection

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16803 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
aurel 2005-10-18 21:40:17 +00:00
parent 6c95f845f5
commit d1f3dd4bcc
2 changed files with 21 additions and 10 deletions

19
configure vendored
View File

@ -6181,6 +6181,8 @@ if test "$_mencoder" != no ; then
echocheck "libmp3lame (for mencoder)"
_mp3lame=no
_def_mp3lame_preset='#undef HAVE_MP3LAME_PRESET'
_def_mp3lame_preset_medium='#undef HAVE_MP3LAME_PRESET_MEDIUM'
cat > $TMPC <<EOF
#include <lame/lame.h>
int main(void) { lame_version_t lv; (void) lame_init(); get_lame_version_numerical(&lv); printf("%d%d\n",lv.major,lv.minor); return 0; }
@ -6188,12 +6190,20 @@ EOF
# Note: libmp3lame usually depends on vorbis
cc_check -lmp3lame $_ld_vorbis $_ld_lm && "$TMPO" >> "$TMPLOG" 2>&1 && _mp3lame=yes
if test "$_mp3lame" = yes ; then
_def_mp3lame="#define HAVE_MP3LAME `$TMPO`"
_def_cfg_mp3lame="#define CONFIG_MP3LAME `$TMPO`"
_def_mp3lame="#define HAVE_MP3LAME"
_ld_mp3lame="-lmp3lame $_ld_vorbis"
cat > $TMPC << EOF
#include <lame/lame.h>
int main(void) { int p = STANDARD_FAST; return 0; }
EOF
cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset="#define HAVE_MP3LAME_PRESET"
cat > $TMPC << EOF
#include <lame/lame.h>
int main(void) { int p = MEDIUM_FAST; return 0; }
EOF
cc_check $_ld_mp3lame $_ld_lm && _def_mp3lame_preset_medium="#define HAVE_MP3LAME_PRESET_MEDIUM"
else
_def_mp3lame='#undef HAVE_MP3LAME'
_def_cfg_mp3lame='#undef CONFIG_MP3LAME'
fi
echores "$_mp3lame"
@ -7184,7 +7194,8 @@ $_def_encore
/* Indicates if libmp3lame is available
Note: for mencoder */
$_def_mp3lame
$_def_cfg_mp3lame
$_def_mp3lame_preset
$_def_mp3lame_preset_medium
/* Define libmp1e for realtime mpeg encoding (for DXR3 and DVB cards) */
$_def_mp1e

View File

@ -32,7 +32,7 @@ static int lame_param_free_format = 0; //disabled
static int lame_param_br_min = 0; //not specified
static int lame_param_br_max = 0; //not specified
#if HAVE_MP3LAME >= 392
#ifdef HAVE_MP3LAME_PRESET
int lame_param_fast=0; // unset
static char* lame_param_preset=NULL; // unset
static int lame_presets_set( lame_t gfp, int fast, int cbr, const char* preset_name );
@ -57,7 +57,7 @@ m_option_t lameopts_conf[]={
{"free", &lame_param_free_format, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"br_min", &lame_param_br_min, CONF_TYPE_INT, CONF_RANGE, 0, 1024, NULL},
{"br_max", &lame_param_br_max, CONF_TYPE_INT, CONF_RANGE, 0, 1024, NULL},
#if HAVE_MP3LAME >= 392
#ifdef HAVE_MP3LAME_PRESET
{"fast", &lame_param_fast, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"preset", &lame_param_preset, CONF_TYPE_STRING, 0, 0, 0, NULL},
#else
@ -181,7 +181,7 @@ int mpae_init_lame(audio_encoder_t *encoder)
}
if(lame_param_lowpassfreq>=-1) lame_set_lowpassfreq(lame,lame_param_lowpassfreq);
if(lame_param_highpassfreq>=-1) lame_set_highpassfreq(lame,lame_param_highpassfreq);
#if HAVE_MP3LAME >= 392
#ifdef HAVE_MP3LAME_PRESET
if(lame_param_preset != NULL) {
mp_msg(MSGT_FIXME, MSGL_FIXME, MSGTR_LamePresetEquals,lame_param_preset);
if(lame_presets_set(lame,lame_param_fast, (lame_param_vbr==0), lame_param_preset) < 0)
@ -205,7 +205,7 @@ int mpae_init_lame(audio_encoder_t *encoder)
return 1;
}
#if HAVE_MP3LAME >= 392
#ifdef HAVE_MP3LAME_PRESET
/* lame_presets_set
taken out of presets_set in lame-3.93.1/frontend/parse.c and modified */
static int lame_presets_set( lame_t gfp, int fast, int cbr, const char* preset_name )
@ -256,7 +256,7 @@ static int lame_presets_set( lame_t gfp, int fast, int cbr, const char* preset_
preset_name = "256";
}
#if HAVE_MP3LAME >= 393
#ifdef HAVE_MP3LAME_PRESET_MEDIUM
if (strcmp(preset_name, "medium") == 0) {
if (fast > 0)
lame_set_preset(gfp, MEDIUM_FAST);
@ -321,7 +321,7 @@ static int lame_presets_set( lame_t gfp, int fast, int cbr, const char* preset_
}
#endif
#if HAVE_MP3LAME >= 392
#ifdef HAVE_MP3LAME_PRESET
/* lame_presets_longinfo_dm
taken out of presets_longinfo_dm in lame-3.93.1/frontend/parse.c and modified */
static void lame_presets_longinfo_dm ( FILE* msgfp )