Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 6eb6a4950a19b14c5850b3c5306c874d > files > 7

mythtv-0.24-27162.3.src.rpm

Index: configure
===================================================================
--- configure	(revision 27174)
+++ configure	(working copy)
@@ -1924,7 +1924,7 @@
 enable hdpvr
 enable iptv
 enable ivtv
-enable lamemp3
+disable libmp3lame
 enable lirc
 enable mheg
 enable mythtranscode
@@ -3927,10 +3927,6 @@
 }
 EOF
 
-# Check that all MythTV build "requirements" are met:
-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)"
@@ -4552,6 +4548,8 @@
 enabled audio_pulse       && append CCONFIG "using_pulse"
 enabled audio_pulseoutput && append CCONFIG "using_pulseoutput"
 
+enabled libmp3lame        && append CCONFIG "using_lame"
+
 if enabled darwin_da; then
   append CCONFIG "darwin_da"
   echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> $MYTH_CONFIG_MAK
Index: libs/libmythtv/NuppelVideoRecorder.cpp
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.cpp	(revision 27174)
+++ libs/libmythtv/NuppelVideoRecorder.cpp	(working copy)
@@ -82,7 +82,11 @@
     pid = pid2 = 0;
     inputchannel = 1;
     compression = 1;
+#ifdef LAME
     compressaudio = 1;
+#else
+    compressaudio = 0;
+#endif
     usebttv = 1;
     width  = 352;
     height = 240;
@@ -94,11 +98,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;
 
@@ -197,10 +203,12 @@
     }
     if (rtjc)
         delete rtjc;
+#ifdef LAME
     if (mp3buf)
         delete [] mp3buf;
     if (gf)
         lame_close(gf);
+#endif
     if (strm)
         delete [] strm;
     if (audio_device)
@@ -321,8 +329,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")
@@ -416,13 +426,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");
@@ -791,6 +804,7 @@
 
     if (compressaudio)
     {
+#ifdef LAME
         gf = lame_init();
         lame_set_bWriteVbrTag(gf, 0);
         lame_set_quality(gf, mp3quality);
@@ -811,9 +825,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;
 }
@@ -2124,6 +2146,7 @@
         moredata.rtjpeg_chroma_filter = M2;
     }
 
+#ifdef LAME
     if (compressaudio)
     {
         moredata.audio_fourcc = FOURCC_LAME;
@@ -2131,6 +2154,7 @@
         moredata.audio_quality = mp3quality;
     }
     else
+#endif
     {
         moredata.audio_fourcc = FOURCC_RAWA;
     }
@@ -3326,6 +3350,7 @@
         }
     }
 
+#ifdef LAME
     if (compressaudio)
     {
         char mp3gapless[7200];
@@ -3382,6 +3407,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 27174)
+++ libs/libmythtv/libmythtv.pro	(working copy)
@@ -62,7 +62,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 += $$EXTRA_LIBS $$QMAKE_LIBS_DYNLOAD
 !contains( CONFIG_LIBMPEG2EXTERNAL, yes) {
         DEPENDPATH  += ../libmythmpeg2
@@ -567,6 +566,12 @@
         DEFINES += USING_DVB
     }
 
+    # LAME MP3 Compression enabled
+    using_lame {
+        DEFINES += LAME
+        LIBS += -lmp3lame
+    }
+
     DEFINES += USING_BACKEND
 }
 
Index: libs/libmythtv/NuppelVideoRecorder.h
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.h	(revision 27174)
+++ libs/libmythtv/NuppelVideoRecorder.h	(working copy)
@@ -7,6 +7,8 @@
 #include <sys/time.h>
 #include <time.h>
 #include <pthread.h>
+
+#ifdef LAME
 #ifdef MMX
 #undef MMX
 #define MMXBLAH
@@ -15,6 +17,7 @@
 #ifdef MMXBLAH
 #define MMX
 #endif
+#endif
 
 #undef HAVE_AV_CONFIG_H
 extern "C" {
@@ -170,10 +173,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 27174)
+++ 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");
         }
@@ -1458,7 +1468,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())
         {