Could MP3 support be made optional?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
RedDwarf
Prole
Posts: 1
Joined: Sun Feb 20, 2011 12:03 pm

Could MP3 support be made optional?

Post by RedDwarf »

Something like this:

Code: Select all

Index: configure.in
===================================================================
--- configure.in.orig
+++ configure.in
@@ -36,7 +35,7 @@ AC_SEARCH_LIBS([TIFFOpen], [tiff], [], A
 AC_SEARCH_LIBS([FT_Load_Glyph], [freetype], [], AC_MSG_ERROR([Can't LÖVE without FreeType]))
 AC_SEARCH_LIBS([PHYSFS_init], [physfs], [], AC_MSG_ERROR([Can't LÖVE without PhysicsFS]))
 AC_SEARCH_LIBS([ModPlug_Load], [modplug], [], AC_MSG_ERROR([Can't LÖVE without ModPlug]))
-AC_SEARCH_LIBS([mpg123_open_feed], [mpg123], [], AC_MSG_ERROR([Can't LÖVE without Mpg123]))
+AC_SEARCH_LIBS([mpg123_open_feed], [mpg123], [AC_DEFINE([WITH_MPG123], [], [Description for mpg123])], AC_MSG_WARN([Mpg123 is not available]))
 AC_SEARCH_LIBS([mpg123_seek_64], [mpg123], AC_SUBST([FILE_OFFSET],[-D_FILE_OFFSET_BITS=64]), AC_SUBST([FILE_OFFSET],[]))
 AC_SEARCH_LIBS([ov_open], [vorbisfile], [], AC_MSG_ERROR([Can't LÖVE without VorbisFile]))
 AC_CONFIG_FILES([
Index: src/modules/sound/lullaby/Mpg123Decoder.cpp
===================================================================
--- src/modules/sound/lullaby/Mpg123Decoder.cpp.orig
+++ src/modules/sound/lullaby/Mpg123Decoder.cpp
@@ -18,6 +18,10 @@
 * 3. This notice may not be removed or altered from any source distribution.
 **/
 
+#include "../config.h"
+
+#ifdef WITH_MPG123
+
 #include "Mpg123Decoder.h"
 
 #include <common/Exception.h>
@@ -227,3 +231,4 @@ namespace lullaby
 } // lullaby
 } // sound
 } // love
+#endif
Index: src/modules/sound/lullaby/Mpg123Decoder.h
===================================================================
--- src/modules/sound/lullaby/Mpg123Decoder.h.orig
+++ src/modules/sound/lullaby/Mpg123Decoder.h
@@ -17,7 +17,9 @@
 *    misrepresented as being the original software.
 * 3. This notice may not be removed or altered from any source distribution.
 **/
+#include "../config.h"
 
+#ifdef WITH_MPG123
 #ifndef LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
 #define LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
 
@@ -77,3 +79,4 @@ namespace lullaby
 } // love
 
 #endif // LOVE_SOUND_LULLABY_LIBMPG123_DECODER_H
+#endif
Index: src/modules/sound/lullaby/Sound.cpp
===================================================================
--- src/modules/sound/lullaby/Sound.cpp.orig
+++ src/modules/sound/lullaby/Sound.cpp
@@ -18,10 +18,14 @@
 * 3. This notice may not be removed or altered from any source distribution.
 **/
 
+#include "../config.h"
+
 #include "Sound.h"
 
 #include "ModPlugDecoder.h"
+#ifdef WITH_MPG123
 #include "Mpg123Decoder.h"
+#endif
 #include "VorbisDecoder.h"
 //#include "FLACDecoder.h"
 
@@ -37,7 +41,9 @@ namespace lullaby
 
 	Sound::~Sound()
 	{
+		#ifdef WITH_MPG123
 		Mpg123Decoder::quit();
+		#endif
 	}
 
 	const char * Sound::getName() const
@@ -55,8 +61,10 @@ namespace lullaby
 		// Find a suitable decoder here, and return it.
 		if(ModPlugDecoder::accepts(ext))
 			decoder = new ModPlugDecoder(data, ext, bufferSize);
+		#ifdef WITH_MPG123
 		else if(Mpg123Decoder::accepts(ext))
 			decoder = new Mpg123Decoder(data, ext, bufferSize);
+		#endif
 		else if(VorbisDecoder::accepts(ext))
 			decoder = new VorbisDecoder(data, ext, bufferSize);
 		/*else if (FLACDecoder::accepts(ext))
It would help package it in distributions that can't package MP3 support because of patents.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Could MP3 support be made optional?

Post by thelinx »

Sounds like a good idea.

You might want to submit it to the issue tracker.
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: Could MP3 support be made optional?

Post by nevon »

Wouldn't that impede with Löve's philosophy that a Löve game should run, completely unmodified, on any platform that Löve supports (unless the Lover has specifically introduced platform specific features)?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Could MP3 support be made optional?

Post by Robin »

Plus, it looks more like something for µLÖVE. I get a database error, hopefully it'll be fixed soon. EDIT: you can view the source, though, that works fine.
Help us help you: attach a .love.
MrJones
Prole
Posts: 2
Joined: Tue Sep 09, 2014 10:24 am

Re: Could MP3 support be made optional?

Post by MrJones »

What about offering a download of love for windows without mp3 support?

I don't care about more formats or anything, but mp3 still appears to be patent encumbered and Technicolor appears to be actively sueing people for distributing mp3 decoders without license (see http://en.wikipedia.org/wiki/MP3#Licens ... ent_issues). FWIW, I think that is also why LAME also doesn't provide any compiled binaries of their dll for that reason on their website. See here for mp3 fees, which I'm sure no indie dev is looking forward to pay: http://www.mp3licensing.com/royalty/

So if some indie devs want to sell a game and distribute love along with it, you'd do them a favor by providing a version without mp3 support.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Could MP3 support be made optional?

Post by slime »

You can compile LÖVE without mpg123 decoding support, it was made optional several years ago (and this thread is 3.5 years old.)

Maybe LÖVE's code could eventually dynamically load the library at runtime though, so you could just remove the mpg123 dll from your game rather than recompiling LÖVE.
MrJones wrote:Technicolor appears to be actively sueing people for distributing mp3 decoders without license (see http://en.wikipedia.org/wiki/MP3#Licens ... ent_issues).
The link in the Wikipedia page is dead (and that part was added to the wiki page 4 years ago.) Do you have some recent examples?
Zvoc47
Prole
Posts: 2
Joined: Fri Apr 29, 2016 5:52 pm

Re: Could MP3 support be made optional?

Post by Zvoc47 »

I'm not sure if I may bump this topic, but I need help. I try to remove mpg123.dll from the game's folder and the EXE file just won't work. Also, I'd like a totally GPL-/LGPL-less game engine because I really don't like that license as it could terminate rights of players who would reverse-engineer my game (I'd like them to reverse-engineer it, though). Reverse-engineered binaries cannot be shown in source code and cannot comply with GPL/LGPL.
User avatar
pgimeno
Party member
Posts: 3550
Joined: Sun Oct 18, 2015 2:58 pm

Re: Could MP3 support be made optional?

Post by pgimeno »

I don't know where you get that the GPL/LGPL don't allow reverse engineering. There's no such provision. The LGPL v2.x in particular includes this statement:
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
and there's a similar one for the LGPL v3.0. It therefore encourages licenses that allow reverse engineering. It also doesn't explicitly prohibit reverse engineering, like many proprietary EULAs do, therefore it's in pretty much the same situation as the X11 or the ZLib or the WTFPL license.
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Could MP3 support be made optional?

Post by slime »

As I mentioned in my previous post, you will have to recompile LÖVE if you don't want libmpg123. It and OpenAL Soft are the only two LGPL libraries LÖVE 0.10 uses.

None of LÖVE's code (including love.exe and love.dll) or any of the libraries aside from those two are LGPL anyway though. Your game (and LÖVE's code) won't inherit any of the LGPL.
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 217 guests