Permalink
Browse files

Merge pull request #4032 from Memphiz/ios7mpeg2crash

[ios7/ios/atv2] - link statically against libmpeg2 - since ios7 we crash...
  • Loading branch information...
2 parents 63e652f + 0e53fea commit f3a11fe574023a3eefd99711308165aee79789f6 @Memphiz Memphiz committed Jan 16, 2014
@@ -13294,6 +13294,7 @@
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
"-lxslt",
+ "-lmpeg2",
);
PLIST_FILE_OUTPUT_FORMAT = xml;
PREBINDING = NO;
@@ -13409,6 +13410,7 @@
"-L$XBMC_DEPENDS/lib/mysql",
"-lmysqlclient",
"-lxslt",
+ "-lmpeg2",
);
PLIST_FILE_OUTPUT_FORMAT = xml;
PREBINDING = NO;
View
@@ -1250,7 +1250,12 @@ XB_FIND_SONAME([VORBIS], [vorbis])
XB_FIND_SONAME([VORBISFILE], [vorbisfile])
XB_FIND_SONAME([MODPLUG], [modplug])
XB_FIND_SONAME([ASS], [ass])
-XB_FIND_SONAME([MPEG2], [mpeg2])
+
+#link statically against mpeg2 on ios because of ios7
+#crash & burn if dyloaded
+if test "$ARCH" != "arm-osx" ; then
+ XB_FIND_SONAME([MPEG2], [mpeg2])
+fi
# Audio encoders
if test "x$use_libmp3lame" != "xno"; then
@@ -40,6 +40,6 @@ COPY_PHASE_STRIP = NO
DEAD_CODE_STRIPPING = NO
OTHER_CPLUSPLUSFLAGS = $(inherited) $(OTHER_CFLAGS) -Wreorder
-OTHER_LDFLAGS = $(XBMC_OTHER_LDFLAGS_COMMON) -weak_framework VideoToolbox
+OTHER_LDFLAGS = $(XBMC_OTHER_LDFLAGS_COMMON) -lmpeg2 -weak_framework VideoToolbox
GCC_PREPROCESSOR_DEFINITIONS = TARGET_DARWIN_IOS $(XBMC_GCC_PREPROCESSOR_DEFINITIONS_COMMON)
@@ -51,6 +51,11 @@ ifeq ($(OS),android)
-$(READELF) --dynamic $(PREFIX)/lib/libxbmpeg2convert.so | grep ibrary
#
endif
+#on ios we link statically against libmpeg2 because of crash&burn since ios7 -
+#so remove the dylib so the linker doesn't see it
+ifeq ($(OS),ios)
+ rm -f $(PREFIX)/lib/libmpeg2.la $(PREFIX)/lib/libmpeg2.dylib $(PREFIX)/lib/libmpeg2.0.dylib
+endif
touch $@
clean:
@@ -23,6 +23,11 @@
#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS)
#include "config.h"
#endif
+
+#if defined(TARGET_DARWIN_IOS)
+#define STATIC_LINK 1
+#endif//TARGET_DARWIN_IOS
+
extern "C" {
#if defined(TARGET_WINDOWS)
#include "libmpeg2/mpeg2.h"
@@ -53,6 +58,31 @@ class DllLibMpeg2Interface
virtual void mpeg2_skip(mpeg2dec_t * mpeg2dec, int skip)=0;
};
+#if defined(STATIC_LINK)
+//use direct mapping
+class DllLibMpeg2 : public DllDynamic, DllLibMpeg2Interface
+{
+public:
+ virtual ~DllLibMpeg2() {}
+ virtual uint32_t mpeg2_accel (uint32_t accel) { return ::mpeg2_accel(accel); }
+ virtual mpeg2dec_t * mpeg2_init (void) { return ::mpeg2_init(); }
+ virtual const mpeg2_info_t * mpeg2_info (mpeg2dec_t * mpeg2dec) { return ::mpeg2_info(mpeg2dec); }
+ virtual void mpeg2_close (mpeg2dec_t * mpeg2dec) { ::mpeg2_close(mpeg2dec); }
+ virtual void mpeg2_buffer (mpeg2dec_t * mpeg2dec, uint8_t * start, uint8_t * end) { ::mpeg2_buffer(mpeg2dec, start, end); }
+ virtual void mpeg2_tag_picture (mpeg2dec_t * mpeg2dec, uint32_t tag, uint32_t tag2){ ::mpeg2_tag_picture(mpeg2dec, tag, tag2); }
+ virtual mpeg2_state_t mpeg2_parse (mpeg2dec_t * mpeg2dec) { return ::mpeg2_parse(mpeg2dec); }
+ virtual void mpeg2_reset (mpeg2dec_t * mpeg2dec, int full_reset) { return ::mpeg2_reset(mpeg2dec, full_reset); }
+ virtual void mpeg2_set_buf (mpeg2dec_t * mpeg2dec, uint8_t * buf[3], void * id) { ::mpeg2_set_buf(mpeg2dec, buf, id); }
+ virtual void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf) { ::mpeg2_custom_fbuf(mpeg2dec, custom_fbuf); }
+ virtual int mpeg2_convert (mpeg2dec_t * mpeg2dec, mpeg2_convert_t convert, void * arg) { return ::mpeg2_convert(mpeg2dec, convert, arg); }
+ virtual void mpeg2_skip(mpeg2dec_t * mpeg2dec, int skip) { ::mpeg2_skip(mpeg2dec, skip); }
+
+ // DLL faking.
+ virtual bool ResolveExports() { return true; }
+ virtual bool Load() { return true; }
+ virtual void Unload() { }
+};
+#else
class DllLibMpeg2 : public DllDynamic, DllLibMpeg2Interface
{
DECLARE_DLL_WRAPPER(DllLibMpeg2, DLL_PATH_LIBMPEG2)
@@ -83,3 +113,4 @@ class DllLibMpeg2 : public DllDynamic, DllLibMpeg2Interface
RESOLVE_METHOD(mpeg2_skip)
END_METHOD_RESOLVE()
};
+#endif//STATIC_LINK

0 comments on commit f3a11fe

Please sign in to comment.