Sophie

Sophie

distrib > Mandriva > 2010.1 > i586 > media > contrib-updates-src > by-pkgid > 0d76e574c626809d07888a31c37ccbf7 > files > 7

mythtv-0.23-27202.1mdv2010.1.src.rpm

Index: configure
===================================================================
--- configure	(revision 25125)
+++ configure	(working copy)
@@ -1772,7 +1772,7 @@
 enable hdpvr
 enable iptv
 enable ivtv
-enable lamemp3
+disable libmp3lame
 enable lirc
 enable mheg
 enable opengl
@@ -3760,9 +3760,6 @@
 enabled freetype2 ||
     die "ERROR! You must have FreeType installed to compile MythTV."
 
-enabled lamemp3 && check_lib2 lame/lame.h lame_init -lmp3lame -lm ||
-    die "ERROR! You must have the Lame MP3 encoding library installed to compile MythTV."
-
 # Qt dependency checks
 qt_inc="-I${sysroot}/$(${qmake} -query QT_INSTALL_HEADERS)"
 qt_libs="-L${sysroot}/$(${qmake} -query QT_INSTALL_LIBS)"
@@ -4351,6 +4348,11 @@
 echo "RUNPREFIX=$runprefix" >> $MYTH_CONFIG_MAK
 echo "SYSROOT=$sysroot" >> $MYTH_CONFIG_MAK
 
+if enabled libmp3lame; then
+    append CCONFIG "using_lame"
+    echo "CONFIG_MP3_LIBS=-lmp3lame" >> $MYTH_CONFIG_MAK
+fi
+
 if enabled audio_oss; then
     append CCONFIG "using_oss"
 fi
Index: libs/libmythtv/NuppelVideoRecorder.cpp
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.cpp	(revision 25125)
+++ libs/libmythtv/NuppelVideoRecorder.cpp	(working copy)
@@ -73,7 +73,11 @@
     pid = pid2 = 0;
     inputchannel = 1;
     compression = 1;
+#ifdef LAME
     compressaudio = 1;
+#else
+    compressaudio = 0;
+#endif
     usebttv = 1;
     w = 352;
     h = 240;
@@ -85,11 +89,13 @@
     framerate_multiplier = 1.0;
     height_multiplier = 1.0;
 
+#ifdef LAME
     mp3quality = 3;
     gf = NULL;
+    mp3buf = NULL;
+#endif
     rtjc = NULL;
     strm = NULL;
-    mp3buf = NULL;
 
     transcoding = false;
 
@@ -188,10 +194,12 @@
     }
     if (rtjc)
         delete rtjc;
+#ifdef LAME
     if (mp3buf)
         delete [] mp3buf;
     if (gf)
         lame_close(gf);
+#endif
     if (strm)
         delete [] strm;
     if (audio_device)
@@ -312,8 +320,10 @@
         hmjpg_vdecimation = value;
     else if (opt == "audiocompression")
         compressaudio = value;
+#ifdef LAME
     else if (opt == "mp3quality")
         mp3quality = value;
+#endif
     else if (opt == "samplerate")
         audio_samplerate = value;
     else if (opt == "audioframesize")
@@ -407,13 +417,16 @@
     if ((tmp = profile->byName("audiocodec")))
         setting = tmp->getValue();
 
+#ifdef LAME
     if (setting == "MP3")
     {
         SetOption("audiocompression", 1);
         SetIntOption(profile, "mp3quality");
         SetIntOption(profile, "samplerate");
     }
-    else if (setting == "Uncompressed")
+    else
+#endif
+         if (setting == "Uncompressed")
     {
         SetOption("audiocompression", 0);
         SetIntOption(profile, "samplerate");
@@ -718,6 +731,7 @@
 
     if (compressaudio)
     {
+#ifdef LAME
         gf = lame_init();
         lame_set_bWriteVbrTag(gf, 0);
         lame_set_quality(gf, mp3quality);
@@ -738,9 +752,17 @@
                     "AudioInit(): lame support requires 16bit audio");
             compressaudio = false;
         }
+#else
+        VERBOSE(VB_IMPORTANT, LOC_ERR +
+                "AudioInit(): support for LAME MP3 compression not enabled, disabling");
+        compressaudio = false;
+#endif
     }
+
+#ifdef LAME
     mp3buf_size = (int)(1.25 * 16384 + 7200);
     mp3buf = new char[mp3buf_size];
+#endif
 
     return 0;
 }
@@ -2013,6 +2035,7 @@
         moredata.rtjpeg_chroma_filter = M2;
     }
 
+#ifdef LAME
     if (compressaudio)
     {
         moredata.audio_fourcc = FOURCC_LAME;
@@ -2020,6 +2043,7 @@
         moredata.audio_quality = mp3quality;
     }
     else
+#endif
     {
         moredata.audio_fourcc = FOURCC_RAWA;
     }
@@ -3205,6 +3229,7 @@
         }
     }
 
+#ifdef LAME
     if (compressaudio)
     {
         char mp3gapless[7200];
@@ -3261,6 +3286,7 @@
         audiobytes += audio_buffer_size;
     }
     else
+#endif
     {
         frameheader.comptype = '0'; // uncompressed audio
         frameheader.packetlength = audio_buffer_size;
Index: libs/libmythtv/libmythtv.pro
===================================================================
--- libs/libmythtv/libmythtv.pro	(revision 25125)
+++ libs/libmythtv/libmythtv.pro	(working copy)
@@ -52,7 +52,6 @@
 using_mheg: LIBS += -L../libmythfreemheg -lmythfreemheg-$$LIBVERSION
 using_live: LIBS += -L../libmythlivemedia -lmythlivemedia-$$LIBVERSION
 using_hdhomerun: LIBS += -L../libmythhdhomerun -lmythhdhomerun-$$LIBVERSION
-using_backend: LIBS += -lmp3lame
 LIBS += -lz $$EXTRA_LIBS $$QMAKE_LIBS_DYNLOAD
 
 TARGETDEPS += ../libmyth/libmyth-$${MYTH_SHLIB_EXT}
@@ -546,6 +545,12 @@
         DEFINES += USING_DVB
     }
 
+    # LAME MP3 Compression enabled
+    using_lame {
+        DEFINES += LAME
+        LIBS += $$MP3_LIBS
+    }
+
     DEFINES += USING_BACKEND
 }
 
Index: libs/libmythtv/NuppelVideoRecorder.h
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.h	(revision 25125)
+++ libs/libmythtv/NuppelVideoRecorder.h	(working copy)
@@ -5,6 +5,8 @@
 #include <sys/time.h>
 #include <time.h>
 #include <pthread.h>
+
+#ifdef LAME
 #ifdef MMX
 #undef MMX
 #define MMXBLAH
@@ -13,6 +15,7 @@
 #ifdef MMXBLAH
 #define MMX
 #endif
+#endif
 
 #include "filter.h"
 #include "minilzo.h"
@@ -167,10 +170,12 @@
 
     bool transcoding;
 
+#ifdef LAME
     int mp3quality;
     char *mp3buf;
     int mp3buf_size;
     lame_global_flags *gf;
+#endif
 
     RTjpeg *rtjc;
 
Index: libs/libmythtv/recordingprofile.cpp
===================================================================
--- libs/libmythtv/recordingprofile.cpp	(revision 25125)
+++ libs/libmythtv/recordingprofile.cpp	(working copy)
@@ -80,6 +80,7 @@
     }
 };
 
+#ifdef LAME
 class MP3Quality : public SliderSetting, public CodecParamStorage
 {
   public:
@@ -94,6 +95,7 @@
                     "numbers) requires more CPU."));
     };
 };
+#endif
 
 class BTTVVolume : public SliderSetting, public CodecParamStorage
 {
@@ -403,12 +405,16 @@
         addChild(codecName);
         setTrigger(codecName);
 
-        ConfigurationGroup* params = new VerticalConfigurationGroup(false);
+        ConfigurationGroup* params;
+
+#ifdef LAME
+        params = new VerticalConfigurationGroup(false);
         params->setLabel("MP3");
         params->addChild(new SampleRate(parent));
         params->addChild(new MP3Quality(parent));
         params->addChild(new BTTVVolume(parent));
         addTarget("MP3", params);
+#endif
 
         params = new VerticalConfigurationGroup(false, false, true, true);
         params->setLabel("MPEG-2 Hardware Encoder");
@@ -449,13 +455,17 @@
             else
             {
                 // V4L, TRANSCODE (and any undefined types)
+#ifdef LAME
                 codecName->addSelection("MP3");
+#endif
                 codecName->addSelection("Uncompressed");
             }
         }
         else
         {
+#ifdef LAME
             codecName->addSelection("MP3");
+#endif
             codecName->addSelection("Uncompressed");
             codecName->addSelection("MPEG-2 Hardware Encoder");
         }
@@ -1451,7 +1461,11 @@
                 "(:NAME, :VIDEOCODEC, :AUDIOCODEC, :PROFILEGROUP);");
         query.bindValue(":NAME", profName);
         query.bindValue(":VIDEOCODEC", "MPEG-4");
+#ifdef LAME
         query.bindValue(":AUDIOCODEC", "MP3");
+#else
+        query.bindValue(":AUDIOCODEC", "Uncompressed");
+#endif
         query.bindValue(":PROFILEGROUP", group);
         if (!query.exec())
         {
Index: libs/libavcodec/libavcodec.pro
===================================================================
--- libs/libavcodec/libavcodec.pro	(revision 25125)
+++ libs/libavcodec/libavcodec.pro	(working copy)
@@ -450,7 +450,6 @@
 contains( CONFIG_LIBGSM_ENCODER, yes )          { SOURCES *= libgsm.c }
 contains( CONFIG_LIBGSM_MS_DECODER, yes )       { SOURCES *= libgsm.c }
 contains( CONFIG_LIBGSM_MS_ENCODER, yes )       { SOURCES *= libgsm.c }
-contains( CONFIG_LIBMP3LAME_ENCODER, yes )      { SOURCES *= libmp3lame.c }
 contains( CONFIG_LIBOPENCORE_AMRNB_DECODER, yes ) { SOURCES *= libopencore-amr.c }
 contains( CONFIG_LIBOPENCORE_AMRNB_ENCODER, yes ) { SOURCES *= libopencore-amr.c }
 contains( CONFIG_LIBOPENCORE_AMRWB_ENCODER, yes ) { SOURCES *= libopencore-amr.c }
@@ -508,6 +507,10 @@
     LIBS    += $$CONFIG_XVMC_LIBS
 }
 
+using_lame {
+    SOURCES *= libmp3lame.c
+}
+
 contains( HAVE_GPROF, yes ) {
     QMAKE_CFLAGS_RELEASE += -p
     QMAKE_LFLAGS_RELEASE += -p
Index: settings.pro
===================================================================
--- settings.pro	(revision 25125)
+++ settings.pro	(working copy)
@@ -118,6 +118,7 @@
 }
 QMAKE_LIBDIR_OPENGL =
 
+MP3_LIBS = $$CONFIG_MP3_LIBS
 OSS_LIBS = $$CONFiG_AUDIO_OSS_LIBS
 ALSA_LIBS = $$CONFIG_AUDIO_ALSA_LIBS
 JACK_LIBS = $$CONFIG_AUDIO_JACK_LIBS