Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > 7e32e99dff0f8c3cbcc98d3ef5541a0e > files > 6

mythtv-0.21-16564.2mdv2008.0.src.rpm

Index: configure
===================================================================
--- configure	(revision 16318)
+++ configure	(working copy)
@@ -95,7 +95,7 @@
   echo "  --enable-libfaad         enable FAAD support via libfaad [default=no]"
   echo "  --enable-libfaadbin      open libfaad.so.0 at runtime [default=no]"
   echo "  --enable-libgsm          enable GSM support via libgsm [default=no]"
-  echo "  --enable-libmp3lame      enable MP3 encoding via libmp3lame [default=no]"
+  echo "  --disable-libmp3lame     disable MP3 encoding/playback via libmp3lame [default=no]"
   echo "  --enable-libnut          enable NUT (de)muxing via libnut,"
   echo "                           native demuxer exists [default=no]"
   echo "  --enable-libtheora       enable Theora encoding via libtheora [default=no]"
@@ -1158,7 +1158,7 @@
 iptv="yes"
 ivtv="yes"
 joystick_menu="default"
-lamemp3="yes"
+libmp3lame="yes"
 lirc="yes"
 opengl="yes"
 v4l="yes"
@@ -2634,8 +2634,7 @@
 #has_library libmysqlclient || has_library mysql/libmysqlclient ||
 #    die "ERROR! You must have a MySQL library installed to run MythTV."
 #
-enabled lamemp3 && has_library libmp3lame && has_header lame/lame.h ||
-    die "ERROR! You must have the Lame MP3 encoding library installed to compile MythTV."
+enabled libmp3lame && has_library libmp3lame && has_header lame/lame.h || disable libmp3lame
 
 #test for lirc client libraries and headers
 enabled lirc && has_library liblirc_client && check_header lirc/lirc_client.h || disable lirc
@@ -3298,6 +3297,11 @@
     append CCONFIG "using_live"
 fi
 
+if enabled libmp3lame; then
+    append CCONFIG "using_lame"
+    echo "CONFIG_MP3_LIBS=-lmp3lame" >> $MYTH_CONFIG_MAK
+fi
+
 if enabled lirc; then
   echo "CONFIG_LIRC_LIBS=-llirc_client" >> $MYTH_CONFIG_MAK
 fi
Index: libs/libmythtv/NuppelVideoRecorder.cpp
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.cpp	(revision 16318)
+++ libs/libmythtv/NuppelVideoRecorder.cpp	(working copy)
@@ -69,7 +69,11 @@
     pid = pid2 = 0;
     inputchannel = 1;
     compression = 1;
+#ifdef LAME
     compressaudio = 1;
+#else
+    compressaudio = 0;
+#endif
     usebttv = 1;
     w = 352;
     h = 240;
@@ -81,11 +85,14 @@
     framerate_multiplier = 1.0;
     height_multiplier = 1.0;
 
+#ifdef LAME
+    mp3buf = NULL;
     mp3quality = 3;
     gf = NULL;
+#endif
+
     rtjc = NULL;
     strm = NULL;   
-    mp3buf = NULL;
 
     transcoding = false;
 
@@ -183,10 +190,12 @@
     }
     if (rtjc)
         delete rtjc;
+#ifdef LAME
     if (mp3buf)
         delete [] mp3buf;
     if (gf)
-        lame_close(gf);  
+        lame_close(gf);
+#endif
     if (strm)
         delete [] strm;
     if (fd >= 0)
@@ -302,8 +311,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")
@@ -397,13 +408,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");
@@ -734,6 +748,7 @@
 
     if (compressaudio)
     {
+#ifdef LAME
         gf = lame_init();
         lame_set_bWriteVbrTag(gf, 0);
         lame_set_quality(gf, mp3quality);
@@ -754,9 +769,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; 
 }
@@ -1997,6 +2020,7 @@
         moredata.rtjpeg_chroma_filter = M2;
     }
 
+#ifdef LAME
     if (compressaudio)
     {
         moredata.audio_fourcc = FOURCC_LAME;
@@ -2004,6 +2028,7 @@
         moredata.audio_quality = mp3quality;
     }
     else
+#endif
     {
         moredata.audio_fourcc = FOURCC_RAWA;
     }
@@ -3229,6 +3254,7 @@
         }
     }
 
+#ifdef LAME
     if (compressaudio) 
     {
         char mp3gapless[7200];
@@ -3285,6 +3311,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 16318)
+++ libs/libmythtv/libmythtv.pro	(working copy)
@@ -239,6 +239,9 @@
     using_ivtv:HEADERS += ivtvdecoder.h
     using_ivtv:SOURCES += ivtvdecoder.cpp
 
+    # LAME MP3 Compression enabled
+    using_lame:DEFINES += LAME
+
     # On screen display (video output overlay)
     using_fribidi:DEFINES += USING_FRIBIDI
     HEADERS += osd.h                    osdtypes.h
Index: libs/libmythtv/NuppelVideoRecorder.h
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.h	(revision 16318)
+++ 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"
@@ -164,10 +167,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 16318)
+++ libs/libmythtv/recordingprofile.cpp	(working copy)
@@ -78,6 +78,7 @@
     }
 };
 
+#ifdef LAME
 class MP3Quality : public SliderSetting, public CodecParamStorage
 {
   public:
@@ -92,6 +93,7 @@
                     "numbers) requires more CPU."));
     };
 };
+#endif
 
 class BTTVVolume : public SliderSetting, public CodecParamStorage
 {
@@ -401,12 +403,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");
@@ -433,13 +439,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");
         }
@@ -1376,7 +1386,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())
             MythContext::DBError("RecordingProfileEditor::open", query);
Index: libs/libavcodec/libavcodec.pro
===================================================================
--- libs/libavcodec/libavcodec.pro	(revision 16318)
+++ libs/libavcodec/libavcodec.pro	(working copy)
@@ -321,7 +321,6 @@
 contains( CONFIG_LIBFAAC, yes )                 { SOURCES *= libfaac.c }
 contains( CONFIG_LIBFAAD, yes )                 { SOURCES *= libfaad.c }
 contains( CONFIG_LIBGSM, yes )                  { SOURCES *= libgsm.c }
-contains( CONFIG_LIBMP3LAME, yes )              { SOURCES *= libmp3lame.c }
 contains( CONFIG_LIBTHEORA, yes )               { SOURCES *= libtheoraenc.c }
 contains( CONFIG_LIBVORBIS, yes )               { SOURCES *= libvorbis.c }
 contains( CONFIG_LIBX264, yes )                 { SOURCES *= libx264.c }
@@ -374,6 +373,10 @@
     DEFINES += HAVE_DVDV
 }
 
+using_lame {
+    SOURCES *= libmp3lame.c
+}
+
 !contains( CONFIG_SWSCALER, yes )               { SOURCES *= imgresample.c }
 
 contains( HAVE_GPROF, yes ) {
Index: settings.pro
===================================================================
--- settings.pro	(revision 16318)
+++ settings.pro	(working copy)
@@ -104,7 +104,8 @@
 }
 QMAKE_LIBDIR_OPENGL =
 
-EXTRA_LIBS = $$FREETYPE_LIBS -lmp3lame
+EXTRA_LIBS = $$FREETYPE_LIBS
+EXTRA_LIBS += $$CONFIG_MP3_LIBS
 EXTRA_LIBS += $$CONFIG_AUDIO_OSS_LIBS
 EXTRA_LIBS += $$CONFIG_AUDIO_ALSA_LIBS
 EXTRA_LIBS += $$CONFIG_AUDIO_ARTS_LIBS