Ticket #4809: mythplugins-0.21-nolame.patch

File mythplugins-0.21-nolame.patch, 7.5 KB (added by coling, 16 years ago)

Patch to allow building without lame encoding support

  • configure

     
    3232fftw_lib3="yes"
    3333sdl="yes"
    3434aac="no"          # compile fails w/libfaad v2.0
     35mp3lame="yes"
    3536exif="yes"
    3637newexif="yes"
    3738festival="no"     # no config detection/setup routine
     
    9293  --enable-fftw            enable fftw visualizers [$fftw_lib]
    9394  --enable-sdl             use SDL for the synaesthesia output [$sdl]
    9495  --enable-aac             enable AAC/MP4 audio file decompression [$aac]
     96  --enable-libmp3lame      enable MP3 encoding support using LAME [$mp3lame]
    9597
    9698MythNews related options:
    9799  --enable-mythnews        build the mythnews plugin [$news]
     
    239241  ;;
    240242  --disable-aac) aac="no"
    241243  ;;
     244  --enable-libmp3lame) mp3lame="yes"
     245  ;;
     246  --disable-libmp3lame) mp3lame="no"
     247  ;;
    242248  --enable-exif) exif="yes"
    243249  ;;
    244250  --enable-new-exif)  newexif="yes"
     
    269275                 visual="yes";
    270276                 fftw_lib="yes";
    271277                 aac="yes";
     278                 mp3lame="yes";
    272279                 exif="yes";
    273280                 festival="yes";
    274281                 archive="yes";
     
    293300                 visual="no";
    294301                 fftw_lib="no";
    295302                 aac="no";
     303                 mp3lame="no";
    296304                 exif="no";
    297305                 festival="no";
    298306                 archive="no";
     
    477485        echo "MythMusic requires CDDA Paranoia."
    478486    fi
    479487
    480     mp3lame="no"
    481     if has_header lame/lame.h && has_library libmp3lame ; then
    482         mp3lame="yes"
    483     else
    484         echo "MythMusic requires the LAME mp3 encoder."
     488    if test "$mp3lame" != "no" ; then
     489        mp3lame="no"
     490        if has_header lame/lame.h && has_library libmp3lame ; then
     491            mp3lame="yes"
     492        fi
    485493    fi
    486494
    487495    taglib="no"
     
    498506        fi
    499507    fi
    500508
    501     if test "$mad" = "no" -o "$vorbis" = "no" -o "$flac" = "no" -o "$mp3lame" = "no" -o "$taglib" = "no" -o "$cdlibs" = "no" ; then
     509    if test "$mad" = "no" -o "$vorbis" = "no" -o "$flac" = "no" -o "$taglib" = "no" -o "$cdlibs" = "no" ; then
    502510        echo "Disabling MythMusic due to missing dependencies."
    503511        music="no"
    504512    fi
     
    802810    if test "$exif" = "no" ; then
    803811        echo "        EXIF           support will not be included in MythGallery"
    804812    fi
     813
     814    if test "$mp3lame" = "yes" ; then
     815        echo "        MP3 encoding   support will be included in MythMusic"
     816        echo "#define LAME 1" >> ./mythmusic/mythmusic/config.h
     817        echo "LIBS += -lmp3lame" >> ./mythmusic/mythmusic/config.pro
     818        echo "HEADERS += lameencoder.h" >> ./mythmusic/mythmusic/config.pro
     819        echo "SOURCES += lameencoder.cpp" >> ./mythmusic/mythmusic/config.pro
     820    fi
     821
     822    if test "$mp3lame" = "no" ; then
     823        echo "        MP3 encoding   support will not be included in MythMusic"
     824    fi
    805825fi
    806826
    807827###########################################################
  • mythmusic/mythmusic/mythmusic.pro

     
    2020
    2121INSTALLS += installfiles uifiles
    2222
    23 LIBS += -lmad -ltag -logg -lvorbisfile -lvorbis -lvorbisenc -lFLAC -lmp3lame
     23LIBS += -lmad -ltag -logg -lvorbisfile -lvorbis -lvorbisenc -lFLAC
    2424
    2525cdaudio: LIBS += -lcdaudio
    2626paranoia:LIBS += -lcdda_paranoia -lcdda_interface
     
    3131HEADERS += metadata.h playbackbox.h playlist.h polygon.h
    3232HEADERS += streaminput.h synaesthesia.h encoder.h visualize.h avfdecoder.h
    3333HEADERS += treecheckitem.h vorbisdecoder.h vorbisencoder.h polygon.h
    34 HEADERS += bumpscope.h globalsettings.h lameencoder.h dbcheck.h
     34HEADERS += bumpscope.h globalsettings.h dbcheck.h
    3535HEADERS += metaio.h metaiotaglib.h vcedit.h metaiooggvorbiscomment.h
    3636HEADERS += metaioflacvorbiscomment.h metaioavfcomment.h
    3737HEADERS += goom/filters.h goom/goomconfig.h goom/goom_core.h goom/graphic.h
     
    4545SOURCES += flacdecoder.cpp flacencoder.cpp maddecoder.cpp main.cpp
    4646SOURCES += mainvisual.cpp metadata.cpp playbackbox.cpp playlist.cpp
    4747SOURCES += streaminput.cpp encoder.cpp dbcheck.cpp
    48 SOURCES += synaesthesia.cpp treecheckitem.cpp vorbisdecoder.cpp lameencoder.cpp
     48SOURCES += synaesthesia.cpp treecheckitem.cpp vorbisdecoder.cpp
    4949SOURCES += vorbisencoder.cpp visualize.cpp bumpscope.cpp globalsettings.cpp
    5050SOURCES += databasebox.cpp genres.cpp
    5151SOURCES += metaio.cpp metaiotaglib.cpp vcedit.c metaiooggvorbiscomment.cpp
  • mythmusic/mythmusic/globalsettings.cpp

     
    2020
    2121// mythmusic
    2222#include "globalsettings.h"
     23#include "config.h"
    2324#include "mainvisual.h"
    2425
    2526// General Settings
     
    174175    HostComboBox *gc = new HostComboBox("EncoderType");
    175176    gc->setLabel(QObject::tr("Encoding"));
    176177    gc->addSelection(QObject::tr("Ogg Vorbis"), "ogg");
     178#ifdef LAME
    177179    gc->addSelection(QObject::tr("Lame (MP3)"), "mp3");
     180#endif
    178181    gc->setHelpText(QObject::tr("Audio encoder to use for CD ripping. "
    179182                    "Note that the quality level 'Perfect' will use the "
    180183                                "FLAC encoder."));
     
    193196    return gc;
    194197};
    195198
     199#ifdef LAME
    196200static HostCheckBox *Mp3UseVBR()
    197201{
    198202    HostCheckBox *gc = new HostCheckBox("Mp3UseVBR");
     
    203207                    "The Ogg encoder will always use variable bitrates."));
    204208    return gc;
    205209};
     210#endif
    206211
    207212static HostLineEdit *FilenameTemplate()
    208213{
     
    696701    encodersettings->setLabel(QObject::tr("CD Ripper Settings (part 2)"));
    697702    encodersettings->addChild(EncoderType());
    698703    encodersettings->addChild(DefaultRipQuality());
     704#ifdef LAME
    699705    encodersettings->addChild(Mp3UseVBR());
     706#endif
    700707    addChild(encodersettings);
    701708}
    702709
  • mythmusic/mythmusic/cdrip.cpp

     
    3737#include <mythtv/mythmediamonitor.h>
    3838
    3939// MythMusic includes
     40#include "config.h"
    4041#include "cdrip.h"
    4142#include "cddecoder.h"
    4243#include "encoder.h"
    4344#include "vorbisencoder.h"
     45#ifdef LAME
    4446#include "lameencoder.h"
     47#endif
    4548#include "flacencoder.h"
    4649#include "genres.h"
    4750#include "editmetadata.h"
     
    172175
    173176    QString textstatus;
    174177    QString encodertype = gContext->GetSetting("EncoderType");
     178#ifdef LAME
    175179    bool mp3usevbr = gContext->GetNumSetting("Mp3UseVBR", 0);
     180#endif
    176181
    177182    m_totalSectors = 0;
    178183    m_totalSectorsDone = 0;
     
    228233
    229234                if (m_quality < 3)
    230235                {
     236#ifdef LAME
    231237                    if (encodertype == "mp3")
    232238                    {
    233239                        outfile += ".mp3";
     
    235241                                                      titleTrack, mp3usevbr));
    236242                    }
    237243                    else // ogg
     244#endif
    238245                    {
    239246                        outfile += ".ogg";
    240247                        encoder.reset(new VorbisEncoder(outfile, m_quality,
  • settings.pro

     
    5959}
    6060QMAKE_LIBDIR_X11 =
    6161
    62 EXTRA_LIBS = -lfreetype -lmp3lame
     62EXTRA_LIBS = -lfreetype
    6363EXTRA_LIBS += $$CONFIG_AUDIO_ALSA_LIBS
    6464EXTRA_LIBS += $$CONFIG_AUDIO_ARTS_LIBS
    6565EXTRA_LIBS += $$CONFIG_AUDIO_JACK_LIBS