aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/DllAvCodec.h40
-rw-r--r--lib/DllSwResample.h68
-rw-r--r--lib/ffmpeg/libavcodec/avcodec.h1
-rw-r--r--lib/ffmpeg/libavformat/matroska.c1
-rw-r--r--lib/ffmpeg/patches/0028-added-support-for-OTF-fonts.patch56
-rw-r--r--lib/groovy/commons-lang-2.6.jarbin0 -> 284220 bytes
-rw-r--r--lib/groovy/groovy-all-1.8.4.jarbin0 -> 6143125 bytes
-rw-r--r--lib/libUPnP/Makefile.in2
-rw-r--r--lib/libass/libass/ass_render.c3
-rw-r--r--lib/libass/libass/ass_shaper.c14
-rw-r--r--lib/libass/libass/ass_utils.h6
-rw-r--r--lib/libass/xbmc/libass_win32/libass_win32_vs2010.vcxproj10
-rw-r--r--lib/libexif/ExifParse.cpp31
-rw-r--r--lib/libexif/libexif.h7
-rw-r--r--lib/taglib/Makefile37
15 files changed, 214 insertions, 62 deletions
diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h
index 7805d342fa..752d36a4f2 100644
--- a/lib/DllAvCodec.h
+++ b/lib/DllAvCodec.h
@@ -58,20 +58,8 @@ extern "C" {
#include <ffmpeg/avformat.h>
#endif
#endif
-
- /* From non-public audioconvert.h */
- struct AVAudioConvert;
- typedef struct AVAudioConvert AVAudioConvert;
- AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
- enum AVSampleFormat in_fmt, int in_channels,
- const float *matrix, int flags);
- void av_audio_convert_free(AVAudioConvert *ctx);
- int av_audio_convert(AVAudioConvert *ctx,
- void * const out[6], const int out_stride[6],
- const void * const in[6], const int in_stride[6], int len);
#else
#include "libavcodec/avcodec.h"
- #include "libavcodec/audioconvert.h"
#endif
}
@@ -115,13 +103,6 @@ public:
virtual int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)=0;
virtual void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)=0;
virtual AVCodec *av_codec_next(AVCodec *c)=0;
- virtual AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
- enum AVSampleFormat in_fmt , int in_channels,
- const float *matrix , int flags)=0;
- virtual void av_audio_convert_free(AVAudioConvert *ctx)=0;
- virtual int av_audio_convert(AVAudioConvert *ctx,
- void * const out[6], const int out_stride[6],
- const void * const in[6], const int in_stride[6], int len)=0;
virtual int av_dup_packet(AVPacket *pkt)=0;
virtual void av_init_packet(AVPacket *pkt)=0;
};
@@ -189,17 +170,6 @@ public:
virtual void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic) { ::avcodec_default_release_buffer(s, pic); }
virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt) { return ::avcodec_default_get_format(s, fmt); }
virtual AVCodec *av_codec_next(AVCodec *c) { return ::av_codec_next(c); }
- virtual AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
- enum AVSampleFormat in_fmt , int in_channels,
- const float *matrix , int flags)
- { return ::av_audio_convert_alloc(out_fmt, out_channels, in_fmt, in_channels, matrix, flags); }
- virtual void av_audio_convert_free(AVAudioConvert *ctx)
- { ::av_audio_convert_free(ctx); }
-
- virtual int av_audio_convert(AVAudioConvert *ctx,
- void * const out[6], const int out_stride[6],
- const void * const in[6], const int in_stride[6], int len)
- { return ::av_audio_convert(ctx, out, out_stride, in, in_stride, len); }
virtual int av_dup_packet(AVPacket *pkt) { return ::av_dup_packet(pkt); }
virtual void av_init_packet(AVPacket *pkt) { return ::av_init_packet(pkt); }
@@ -251,13 +221,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface
DEFINE_METHOD2(enum PixelFormat, avcodec_default_get_format, (struct AVCodecContext *p1, const enum PixelFormat *p2))
DEFINE_METHOD1(AVCodec*, av_codec_next, (AVCodec *p1))
- DEFINE_METHOD6(AVAudioConvert*, av_audio_convert_alloc, (enum AVSampleFormat p1, int p2,
- enum AVSampleFormat p3, int p4,
- const float *p5, int p6))
- DEFINE_METHOD1(void, av_audio_convert_free, (AVAudioConvert *p1));
- DEFINE_METHOD6(int, av_audio_convert, (AVAudioConvert *p1,
- void * const p2[6], const int p3[6],
- const void * const p4[6], const int p5[6], int p6))
BEGIN_METHOD_RESOLVE()
RESOLVE_METHOD(avcodec_flush_buffers)
RESOLVE_METHOD_RENAME(avcodec_open2,avcodec_open2_dont_call)
@@ -288,9 +251,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface
RESOLVE_METHOD(avcodec_default_release_buffer)
RESOLVE_METHOD(avcodec_default_get_format)
RESOLVE_METHOD(av_codec_next)
- RESOLVE_METHOD(av_audio_convert_alloc)
- RESOLVE_METHOD(av_audio_convert_free)
- RESOLVE_METHOD(av_audio_convert)
RESOLVE_METHOD(av_dup_packet)
RESOLVE_METHOD(av_init_packet)
END_METHOD_RESOLVE()
diff --git a/lib/DllSwResample.h b/lib/DllSwResample.h
index 8a990720c3..05beab6a64 100644
--- a/lib/DllSwResample.h
+++ b/lib/DllSwResample.h
@@ -24,6 +24,7 @@
#include "config.h"
#endif
#include "DynamicDll.h"
+#include "utils/log.h"
extern "C" {
#ifndef HAVE_MMX
@@ -36,17 +37,36 @@ extern "C" {
#pragma warning(disable:4244)
#endif
#if (defined USE_EXTERNAL_FFMPEG)
- #include <libswresample/swresample.h>
+ #if HAVE_LIBSWRESAMPLE_SWRESAMPLE_H
+ #include <libswresample/swresample.h>
+ #elif HAVE_LIBAVRESAMPLE_AVRESAMPLE_H
+ #include <libavresample/avresample.h>
+ #include <libavutil/opt.h>
+ #include <libavutil/samplefmt.h>
+ #define SwrContext AVAudioResampleContext
+ #else
+ #error "Either libswresample or libavresample is needed!"
+ #endif
#else
#include "libswresample/swresample.h"
#endif
}
+class DllSwResampleInterface
+{
+public:
+ virtual ~DllSwResampleInterface() {}
+ virtual struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx)=0;
+ virtual int swr_init(struct SwrContext *s)=0;
+ virtual void swr_free(struct SwrContext **s)=0;
+ virtual int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count)=0;
+};
#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN)
+#if HAVE_LIBSWRESAMPLE_SWRESAMPLE_H || (defined TARGET_DARWIN)
// Use direct mapping
-class DllSwResample : public DllDynamic
+class DllSwResample : public DllDynamic, DllSwResampleInterface
{
public:
virtual ~DllSwResample() {}
@@ -58,17 +78,59 @@ public:
return true;
}
virtual void Unload() {}
+ virtual struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx) { return ::swr_alloc_set_opts(s, out_ch_layout, out_sample_fmt, out_sample_rate, in_ch_layout, in_sample_fmt, in_sample_rate, log_offset, log_ctx); }
+ virtual int swr_init(struct SwrContext *s) { return ::swr_init(s); }
+ virtual void swr_free(struct SwrContext **s){ return ::swr_free(s); }
+ virtual int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count){ return ::swr_convert(s, out, out_count, in, in_count); }
+};
+#else
+// Wrap the same API through libavresample.
+class DllSwResample : public DllDynamic, DllSwResampleInterface
+{
+public:
+ virtual ~DllSwResample() {}
+
+ // DLL faking.
+ virtual bool ResolveExports() { return true; }
+ virtual bool Load() {
+ CLog::Log(LOGDEBUG, "DllAvFormat: Using libavresample system library");
+ return true;
+ }
+ virtual void Unload() {}
+ virtual struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx) {
+ AVAudioResampleContext *ret = ::avresample_alloc_context();
+ av_opt_set_int(ret, "out_channel_layout", out_ch_layout , 0);
+ av_opt_set_int(ret, "out_sample_fmt" , out_sample_fmt , 0);
+ av_opt_set_int(ret, "out_sample_rate" , out_sample_rate, 0);
+ av_opt_set_int(ret, "in_channel_layout" , in_ch_layout , 0);
+ av_opt_set_int(ret, "in_sample_fmt" , in_sample_fmt , 0);
+ av_opt_set_int(ret, "in_sample_rate" , in_sample_rate , 0);
+ return ret;
+ }
+ virtual int swr_init(struct SwrContext *s) { return ::avresample_open(s); }
+ virtual void swr_free(struct SwrContext **s){ ::avresample_close(*s); *s = NULL; }
+ virtual int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, const uint8_t **in , int in_count){ return ::avresample_convert(s, (void**)out, 0, out_count, (void**)in, 0,in_count); }
};
+#endif
#else
-class DllSwResample : public DllDynamic
+class DllSwResample : public DllDynamic, DllSwResampleInterface
{
DECLARE_DLL_WRAPPER(DllSwResample, DLL_PATH_LIBSWRESAMPLE)
LOAD_SYMBOLS()
+ DEFINE_METHOD9(SwrContext*, swr_alloc_set_opts, (struct SwrContext *p1, int64_t p2, enum AVSampleFormat p3, int p4, int64_t p5, enum AVSampleFormat p6, int p7, int p8, void * p9));
+ DEFINE_METHOD1(int, swr_init, (struct SwrContext *p1))
+ DEFINE_METHOD1(void, swr_free, (struct SwrContext **p1))
+ DEFINE_METHOD5(int, swr_convert, (struct SwrContext *p1, uint8_t **p2, int p3, const uint8_t **p4, int p5))
+
BEGIN_METHOD_RESOLVE()
+ RESOLVE_METHOD(swr_alloc_set_opts)
+ RESOLVE_METHOD(swr_init)
+ RESOLVE_METHOD(swr_free)
+ RESOLVE_METHOD(swr_convert)
END_METHOD_RESOLVE()
/* dependencies of libavformat */
diff --git a/lib/ffmpeg/libavcodec/avcodec.h b/lib/ffmpeg/libavcodec/avcodec.h
index 0b756d08e3..6996c9266b 100644
--- a/lib/ffmpeg/libavcodec/avcodec.h
+++ b/lib/ffmpeg/libavcodec/avcodec.h
@@ -435,6 +435,7 @@ enum CodecID {
CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
+ CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
diff --git a/lib/ffmpeg/libavformat/matroska.c b/lib/ffmpeg/libavformat/matroska.c
index 52481d7556..2f5b6178c2 100644
--- a/lib/ffmpeg/libavformat/matroska.c
+++ b/lib/ffmpeg/libavformat/matroska.c
@@ -90,6 +90,7 @@ const CodecMime ff_mkv_mime_tags[] = {
{"image/tiff" , CODEC_ID_TIFF},
{"application/x-truetype-font", CODEC_ID_TTF},
{"application/x-font" , CODEC_ID_TTF},
+ {"application/vnd.ms-opentype", CODEC_ID_OTF},
{"" , CODEC_ID_NONE}
};
diff --git a/lib/ffmpeg/patches/0028-added-support-for-OTF-fonts.patch b/lib/ffmpeg/patches/0028-added-support-for-OTF-fonts.patch
new file mode 100644
index 0000000000..2167d9fb8e
--- /dev/null
+++ b/lib/ffmpeg/patches/0028-added-support-for-OTF-fonts.patch
@@ -0,0 +1,56 @@
+From 864acb01cc73762918794ddecf0fc2f7b6cf8529 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=A9bastien=20Brochet?= <blinkseb@xbmc.org>
+Date: Sun, 15 Apr 2012 22:43:46 +0200
+Subject: [PATCH 1/3] added: support for OTF fonts
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+
+Signed-off-by: Sébastien Brochet <blinkseb@xbmc.org>
+---
+ lib/ffmpeg/libavcodec/avcodec.h | 1 +
+ lib/ffmpeg/libavformat/matroska.c | 1 +
+ xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 2 +-
+ 3 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/ffmpeg/libavcodec/avcodec.h b/lib/ffmpeg/libavcodec/avcodec.h
+index 0b756d0..6996c92 100644
+--- a/lib/ffmpeg/libavcodec/avcodec.h
++++ b/lib/ffmpeg/libavcodec/avcodec.h
+@@ -435,6 +435,7 @@ enum CodecID {
+ CODEC_ID_BINTEXT = MKBETAG('B','T','X','T'),
+ CODEC_ID_XBIN = MKBETAG('X','B','I','N'),
+ CODEC_ID_IDF = MKBETAG( 0 ,'I','D','F'),
++ CODEC_ID_OTF = MKBETAG( 0 ,'O','T','F'),
+
+ CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
+
+diff --git a/lib/ffmpeg/libavformat/matroska.c b/lib/ffmpeg/libavformat/matroska.c
+index 52481d7..2f5b617 100644
+--- a/lib/ffmpeg/libavformat/matroska.c
++++ b/lib/ffmpeg/libavformat/matroska.c
+@@ -90,6 +90,7 @@ const CodecMime ff_mkv_mime_tags[] = {
+ {"image/tiff" , CODEC_ID_TIFF},
+ {"application/x-truetype-font", CODEC_ID_TTF},
+ {"application/x-font" , CODEC_ID_TTF},
++ {"application/vnd.ms-opentype", CODEC_ID_OTF},
+
+ {"" , CODEC_ID_NONE}
+ };
+diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
+index 17cbd48..4524141 100644
+--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp
+@@ -1062,7 +1062,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId)
+ }
+ case AVMEDIA_TYPE_ATTACHMENT:
+ { //mkv attachments. Only bothering with fonts for now.
+- if(pStream->codec->codec_id == CODEC_ID_TTF)
++ if(pStream->codec->codec_id == CODEC_ID_TTF || pStream->codec->codec_id == CODEC_ID_OTF)
+ {
+ std::string fileName = "special://temp/fonts/";
+ XFILE::CDirectory::Create(fileName);
+--
+1.7.10.msysgit.1
+
diff --git a/lib/groovy/commons-lang-2.6.jar b/lib/groovy/commons-lang-2.6.jar
new file mode 100644
index 0000000000..98467d3a65
--- /dev/null
+++ b/lib/groovy/commons-lang-2.6.jar
Binary files differ
diff --git a/lib/groovy/groovy-all-1.8.4.jar b/lib/groovy/groovy-all-1.8.4.jar
new file mode 100644
index 0000000000..1dfccc3781
--- /dev/null
+++ b/lib/groovy/groovy-all-1.8.4.jar
Binary files differ
diff --git a/lib/libUPnP/Makefile.in b/lib/libUPnP/Makefile.in
index 2fcd3d4e9a..e1f94622a0 100644
--- a/lib/libUPnP/Makefile.in
+++ b/lib/libUPnP/Makefile.in
@@ -1,5 +1,6 @@
ARCH=@ARCH@
+ifeq (@USE_UPNP@, 1)
SRCS= Platinum/Source/Core/PltAction.cpp \
Platinum/Source/Core/PltArgument.cpp \
Platinum/Source/Core/PltConstants.cpp \
@@ -93,3 +94,4 @@ LIB=libupnp.a
include ../../Makefile.include
-include $(filter %.P, $(OBJS:.o=.P))
+endif
diff --git a/lib/libass/libass/ass_render.c b/lib/libass/libass/ass_render.c
index b6c0159913..97befdded1 100644
--- a/lib/libass/libass/ass_render.c
+++ b/lib/libass/libass/ass_render.c
@@ -547,7 +547,6 @@ static void blend_vector_clip(ASS_Renderer *render_priv,
ASS_Drawing *drawing = render_priv->state.clip_drawing;
BitmapHashKey key;
BitmapHashValue *val;
- int error;
if (!drawing)
return;
@@ -588,7 +587,7 @@ static void blend_vector_clip(ASS_Renderer *render_priv,
render_priv->ftlibrary, outline, 0);
if (clip_bm == NULL) {
ass_msg(render_priv->library, MSGL_WARN,
- "Clip vector rasterization failed: %d. Skipping.", error);
+ "Clip vector rasterization failed. Skipping.");
}
// Add to cache
diff --git a/lib/libass/libass/ass_shaper.c b/lib/libass/libass/ass_shaper.c
index cf563ada72..6adfc78f92 100644
--- a/lib/libass/libass/ass_shaper.c
+++ b/lib/libass/libass/ass_shaper.c
@@ -349,9 +349,11 @@ static hb_font_t *get_hb_font(ASS_Shaper *shaper, GlyphInfo *info)
{
ASS_Font *font = info->font;
hb_font_t **hb_fonts;
+ struct ass_shaper_metrics_data *metrics;
+ hb_font_funcs_t *funcs;
if (!font->shaper_priv)
- font->shaper_priv = calloc(sizeof(ASS_ShaperFontData), 1);
+ font->shaper_priv = (ASS_ShaperFontData *) calloc(sizeof(ASS_ShaperFontData), 1);
hb_fonts = font->shaper_priv->fonts;
@@ -360,14 +362,13 @@ static hb_font_t *get_hb_font(ASS_Shaper *shaper, GlyphInfo *info)
hb_ft_font_create(font->faces[info->face_index], NULL);
// set up cached metrics access
- font->shaper_priv->metrics_data[info->face_index] =
+ font->shaper_priv->metrics_data[info->face_index] = (struct ass_shaper_metrics_data *)
calloc(sizeof(struct ass_shaper_metrics_data), 1);
- struct ass_shaper_metrics_data *metrics =
- font->shaper_priv->metrics_data[info->face_index];
+ metrics = font->shaper_priv->metrics_data[info->face_index];
metrics->metrics_cache = shaper->metrics_cache;
metrics->vertical = info->font->desc.vertical;
- hb_font_funcs_t *funcs = hb_font_funcs_create();
+ funcs = hb_font_funcs_create();
font->shaper_priv->font_funcs[info->face_index] = funcs;
hb_font_funcs_set_glyph_func(funcs, get_glyph,
metrics, NULL);
@@ -395,8 +396,7 @@ static hb_font_t *get_hb_font(ASS_Shaper *shaper, GlyphInfo *info)
update_hb_size(hb_fonts[info->face_index], font->faces[info->face_index]);
// update hash key for cached metrics
- struct ass_shaper_metrics_data *metrics =
- font->shaper_priv->metrics_data[info->face_index];
+ metrics = font->shaper_priv->metrics_data[info->face_index];
metrics->hash_key.font = info->font;
metrics->hash_key.face_index = info->face_index;
metrics->hash_key.size = info->font_size;
diff --git a/lib/libass/libass/ass_utils.h b/lib/libass/libass/ass_utils.h
index 8bc476c6fe..f0093973da 100644
--- a/lib/libass/libass/ass_utils.h
+++ b/lib/libass/libass/ass_utils.h
@@ -34,6 +34,12 @@
#ifdef _WIN32
#include "config.h"
+// This is needed in debug build. Without those defines, those 3 symbols are taken from msvcr100.dll, and free() from msvcr100d.dll
+// This cause a heap corruption each time a strdup is freed
+// See http://www.altdevblogaday.com/2011/08/02/a-journey-into-linker-hell-and-a-mistake/
+#define strdup _strdup
+#define stricmp _stricmp
+#define strnicmp _strnicmp
#endif
#define MSGL_FATAL 0
diff --git a/lib/libass/xbmc/libass_win32/libass_win32_vs2010.vcxproj b/lib/libass/xbmc/libass_win32/libass_win32_vs2010.vcxproj
index ca210991b5..e9f6857f5e 100644
--- a/lib/libass/xbmc/libass_win32/libass_win32_vs2010.vcxproj
+++ b/lib/libass/xbmc/libass_win32/libass_win32_vs2010.vcxproj
@@ -56,7 +56,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\;..\..\..\enca\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBASS_WIN32_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBASS_WIN32_EXPORTS;CONFIG_HARFBUZZ;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -69,7 +69,7 @@
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
- <AdditionalDependencies>fontconfig.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>fontconfig.lib;zlib.lib;harfbuzz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<IgnoreSpecificDefaultLibraries>libcmt;libcmtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -95,7 +95,7 @@
<ClCompile>
<Optimization>Full</Optimization>
<AdditionalIncludeDirectories>.\;..\..\..\enca\lib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBASS_WIN32_EXPORTS;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBASS_WIN32_EXPORTS;CONFIG_HARFBUZZ;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
@@ -106,7 +106,7 @@
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
</ClCompile>
<Link>
- <AdditionalDependencies>fontconfig.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>fontconfig.lib;zlib.lib;harfbuzz.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<IgnoreSpecificDefaultLibraries>libcmt;libcmtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -175,4 +175,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
-</Project> \ No newline at end of file
+</Project>
diff --git a/lib/libexif/ExifParse.cpp b/lib/libexif/ExifParse.cpp
index 4f39a51b51..635d82f600 100644
--- a/lib/libexif/ExifParse.cpp
+++ b/lib/libexif/ExifParse.cpp
@@ -451,11 +451,32 @@ void CExifParse::ProcessDir(const unsigned char* const DirStart,
case TAG_USERCOMMENT:
{
- const int EXIF_COMMENT_HDR_LENGTH = 8; // All comment tags have 8 bytes of header info
- int length = max(ByteCount - EXIF_COMMENT_HDR_LENGTH, 0);
- length = min(length, MAX_COMMENT);
- strncpy(m_ExifInfo->Comments, (char *)ValuePtr+EXIF_COMMENT_HDR_LENGTH, length);
-// FixComment(comment); // Ensure comment is printable
+ // The UserComment allows comments without the charset limitations of ImageDescription.
+ // Therefore the UserComment field is prefixed by a CharacterCode field (8 Byte):
+ // - ASCII: 'ASCII\0\0\0'
+ // - Unicode: 'UNICODE\0'
+ // - JIS X208-1990: 'JIS\0\0\0\0\0'
+ // - Unknown: '\0\0\0\0\0\0\0\0' (application specific)
+
+ m_ExifInfo->CommentsCharset = EXIF_COMMENT_CHARSET_UNKNOWN;
+
+ const int EXIF_COMMENT_CHARSET_LENGTH = 8;
+ if (ByteCount >= EXIF_COMMENT_CHARSET_LENGTH)
+ {
+ // As some implementations use spaces instead of \0 for the padding,
+ // we're not so strict and check only the prefix.
+ if (memcmp(ValuePtr, "ASCII", 5) == 0)
+ m_ExifInfo->CommentsCharset = EXIF_COMMENT_CHARSET_ASCII;
+ else if (memcmp(ValuePtr, "UNICODE", 7) == 0)
+ m_ExifInfo->CommentsCharset = EXIF_COMMENT_CHARSET_UNICODE;
+ else if (memcmp(ValuePtr, "JIS", 3) == 0)
+ m_ExifInfo->CommentsCharset = EXIF_COMMENT_CHARSET_JIS;
+
+ int length = ByteCount - EXIF_COMMENT_CHARSET_LENGTH;
+ length = min(length, MAX_COMMENT);
+ memcpy(m_ExifInfo->Comments, ValuePtr + EXIF_COMMENT_CHARSET_LENGTH, length);
+// FixComment(comment); // Ensure comment is printable
+ }
}
break;
diff --git a/lib/libexif/libexif.h b/lib/libexif/libexif.h
index f7dc532f0d..605bbebdcc 100644
--- a/lib/libexif/libexif.h
+++ b/lib/libexif/libexif.h
@@ -75,6 +75,12 @@ typedef struct {
char ImageType[MAX_IPTC_STRING];
} IPTCInfo_t;
+#define EXIF_COMMENT_CHARSET_CONVERTED -1 // Comments contains converted data
+#define EXIF_COMMENT_CHARSET_UNKNOWN 0 // Exif: Unknown
+#define EXIF_COMMENT_CHARSET_ASCII 2 // Exif: Ascii
+#define EXIF_COMMENT_CHARSET_UNICODE 3 // Exif: Unicode (UTF-16)
+#define EXIF_COMMENT_CHARSET_JIS 4 // Exif: JIS X208-1990
+
#define MAX_COMMENT 2000
#define MAX_DATE_COPIES 10
@@ -101,6 +107,7 @@ typedef struct {
int ExposureMode;
int ISOequivalent;
int LightSource;
+ int CommentsCharset; // EXIF_COMMENT_CHARSET_*
char Comments[MAX_COMMENT];
char Description[MAX_COMMENT];
diff --git a/lib/taglib/Makefile b/lib/taglib/Makefile
new file mode 100644
index 0000000000..6b524c4a6f
--- /dev/null
+++ b/lib/taglib/Makefile
@@ -0,0 +1,37 @@
+# lib name, version
+LIBNAME=taglib
+VERSION=1.8
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz
+TARBALLS_LOCATION=.
+BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
+RETRIEVE_TOOL=/usr/bin/curl
+RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
+ARCHIVE_TOOL=tar
+ARCHIVE_TOOL_FLAGS=zxf
+
+SO_NAME=libtaglib.so
+
+all: $(SO_NAME)
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); rm -rf build; mkdir -p build
+ cd $(SOURCE)/build; cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_STATIC=1
+$(SO_NAME): $(SOURCE)
+ make -C $(SOURCE)/build
+
+install:
+ make -C $(SOURCE)/build install
+
+clean:
+ make -C $(SOURCE)/build clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed