parent
add8c39867
commit
7fd13ee610
@ -1 +1 @@
|
||||
69d4e30fe4fc2691780fbeacd40359d2 vlc-1.0.2.tar.bz2
|
||||
6e9383e1684506ee2bfbfae011821fdd vlc-1.0.2.tar.bz2
|
||||
|
@ -1,195 +0,0 @@
|
||||
diff --git a/modules/misc/freetype.c b/modules/misc/freetype.c
|
||||
index 7e45866..a0c3a93 100644
|
||||
--- a/modules/misc/freetype.c
|
||||
+++ b/modules/misc/freetype.c
|
||||
@@ -70,6 +70,8 @@
|
||||
|
||||
#ifdef HAVE_FONTCONFIG
|
||||
#include <fontconfig/fontconfig.h>
|
||||
+#undef DEFAULT_FONT
|
||||
+#define DEFAULT_FONT FC_DEFAULT_FONT
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
@@ -81,7 +83,13 @@ static int Create ( vlc_object_t * );
|
||||
static void Destroy( vlc_object_t * );
|
||||
|
||||
#define FONT_TEXT N_("Font")
|
||||
-#define FONT_LONGTEXT N_("Filename for the font you want to use")
|
||||
+
|
||||
+#ifdef HAVE_FONTCONFIG
|
||||
+#define FONT_LONGTEXT N_("Font family for the font you want to use")
|
||||
+#else
|
||||
+#define FONT_LONGTEXT N_("Fontfile for the font you want to use")
|
||||
+#endif
|
||||
+
|
||||
#define FONTSIZE_TEXT N_("Font size in pixels")
|
||||
#define FONTSIZE_LONGTEXT N_("This is the default size of the fonts " \
|
||||
"that will be rendered on the video. " \
|
||||
@@ -284,9 +292,15 @@ static int Create( vlc_object_t *p_this )
|
||||
{
|
||||
filter_t *p_filter = (filter_t *)p_this;
|
||||
filter_sys_t *p_sys;
|
||||
- char *psz_fontfile = NULL;
|
||||
- int i_error;
|
||||
- vlc_value_t val;
|
||||
+ char *psz_fontfile=NULL;
|
||||
+ char *psz_fontfamily=NULL;
|
||||
+ int i_error,fontindex;
|
||||
+
|
||||
+#ifdef HAVE_FONTCONFIG
|
||||
+ FcPattern *fontpattern, *fontmatch;
|
||||
+ FcResult fontresult;
|
||||
+#endif
|
||||
+
|
||||
|
||||
/* Allocate structure */
|
||||
p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
|
||||
@@ -297,52 +311,88 @@ static int Create( vlc_object_t *p_this )
|
||||
p_sys->i_font_size = 0;
|
||||
p_sys->i_display_height = 0;
|
||||
|
||||
- var_Create( p_filter, "freetype-font",
|
||||
- VLC_VAR_STRING | VLC_VAR_DOINHERIT );
|
||||
- var_Create( p_filter, "freetype-fontsize",
|
||||
- VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
|
||||
var_Create( p_filter, "freetype-rel-fontsize",
|
||||
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
|
||||
- var_Create( p_filter, "freetype-opacity",
|
||||
- VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
|
||||
- var_Create( p_filter, "freetype-effect",
|
||||
- VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
|
||||
- var_Get( p_filter, "freetype-opacity", &val );
|
||||
- p_sys->i_font_opacity = __MAX( __MIN( val.i_int, 255 ), 0 );
|
||||
- var_Create( p_filter, "freetype-color",
|
||||
- VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
|
||||
- var_Get( p_filter, "freetype-color", &val );
|
||||
- p_sys->i_font_color = __MAX( __MIN( val.i_int, 0xFFFFFF ), 0 );
|
||||
- p_sys->i_effect = var_GetInteger( p_filter, "freetype-effect" );
|
||||
-
|
||||
- /* Look what method was requested */
|
||||
- var_Get( p_filter, "freetype-font", &val );
|
||||
- psz_fontfile = val.psz_string;
|
||||
- if( !psz_fontfile || !*psz_fontfile )
|
||||
- {
|
||||
- free( psz_fontfile );
|
||||
- psz_fontfile = (char *)malloc( PATH_MAX + 1 );
|
||||
- if( !psz_fontfile )
|
||||
- goto error;
|
||||
-#ifdef WIN32
|
||||
- GetWindowsDirectory( psz_fontfile, PATH_MAX + 1 );
|
||||
- strcat( psz_fontfile, "\\fonts\\arial.ttf" );
|
||||
-#elif defined(__APPLE__)
|
||||
- strcpy( psz_fontfile, DEFAULT_FONT );
|
||||
+
|
||||
+ psz_fontfamily = var_CreateGetString( p_filter, "freetype-font" );
|
||||
+ p_sys->i_default_font_size = var_CreateGetInteger( p_filter, "freetype-fontsize" );
|
||||
+ p_sys->i_effect = var_CreateGetInteger( p_filter, "freetype-effect" );
|
||||
+ p_sys->i_font_opacity = var_CreateGetInteger( p_filter,"freetype-opacity" );
|
||||
+ p_sys->i_font_opacity = __MAX( __MIN( p_sys->i_font_opacity, 255 ), 0 );
|
||||
+ p_sys->i_font_color = var_CreateGetInteger( p_filter, "freetype-color" );
|
||||
+ p_sys->i_font_color = __MAX( __MIN( p_sys->i_font_color , 0xFFFFFF ), 0 );
|
||||
+
|
||||
+ fontindex=0;
|
||||
+ if( !psz_fontfamily || !*psz_fontfamily )
|
||||
+ {
|
||||
+#ifdef HAVE_FONTCONFIG
|
||||
+ free( psz_fontfamily);
|
||||
+ psz_fontfamily=strdup( DEFAULT_FONT );
|
||||
#else
|
||||
- msg_Err( p_filter, "user didn't specify a font" );
|
||||
- goto error;
|
||||
+ free( psz_fontfamily );
|
||||
+ psz_fontfamily = (char *)malloc( PATH_MAX + 1 );
|
||||
+ if( !psz_fontfamily )
|
||||
+ goto error;
|
||||
+# ifdef WIN32
|
||||
+ GetWindowsDirectory( psz_fontfamily , PATH_MAX + 1 );
|
||||
+ strcat( psz_fontfamily, "\\fonts\\arial.ttf" );
|
||||
+# else
|
||||
+ strcpy( psz_fontfamily, DEFAULT_FONT );
|
||||
+# endif
|
||||
+ msg_Err( p_filter,"User didn't specify fontfile, using %s", psz_fontfamily);
|
||||
#endif
|
||||
}
|
||||
|
||||
+#ifdef HAVE_FONTCONFIG
|
||||
+ /* Lets find some fontfile from freetype-font variable family */
|
||||
+ char *psz_fontsize;
|
||||
+ if( asprintf( &psz_fontsize, "%d", p_sys->i_default_font_size ) == -1 )
|
||||
+ goto error;
|
||||
+ fontpattern = FcPatternCreate();
|
||||
+ FcPatternAddString( fontpattern, FC_FAMILY, psz_fontfamily);
|
||||
+ FcPatternAddString( fontpattern, FC_SIZE, psz_fontsize );
|
||||
+
|
||||
+ if( FcConfigSubstitute( NULL, fontpattern, FcMatchPattern ) == FcFalse )
|
||||
+ {
|
||||
+ FcPatternDestroy( fontpattern );
|
||||
+ free( psz_fontsize );
|
||||
+ goto error;
|
||||
+ }
|
||||
+ FcDefaultSubstitute( fontpattern );
|
||||
+
|
||||
+ fontmatch = FcFontMatch( NULL, fontpattern, &fontresult );
|
||||
+ if( fontresult == FcResultNoMatch )
|
||||
+ {
|
||||
+ free( psz_fontsize );
|
||||
+ FcPatternDestroy( fontpattern );
|
||||
+ FcPatternDestroy( fontmatch );
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ FcPatternGetString( fontmatch, FC_FILE, 0, (FcChar8 **)&psz_fontfile);
|
||||
+ FcPatternGetInteger( fontmatch, FC_INDEX, 0, &fontindex );
|
||||
+ free( psz_fontsize );
|
||||
+ if( !psz_fontfile )
|
||||
+ {
|
||||
+ FcPatternDestroy( fontpattern );
|
||||
+ FcPatternDestroy( fontmatch );
|
||||
+ goto error;
|
||||
+ }
|
||||
+ msg_Dbg( p_filter, "Using %s as font from file %s", psz_fontfamily, psz_fontfile);
|
||||
+#else
|
||||
+ psz_fontfile = psz_fontfamily;
|
||||
+#endif
|
||||
+
|
||||
i_error = FT_Init_FreeType( &p_sys->p_library );
|
||||
if( i_error )
|
||||
{
|
||||
msg_Err( p_filter, "couldn't initialize freetype" );
|
||||
goto error;
|
||||
}
|
||||
+
|
||||
i_error = FT_New_Face( p_sys->p_library, psz_fontfile ? psz_fontfile : "",
|
||||
- 0, &p_sys->p_face );
|
||||
+ fontindex, &p_sys->p_face );
|
||||
+
|
||||
if( i_error == FT_Err_Unknown_File_Format )
|
||||
{
|
||||
msg_Err( p_filter, "file %s have unknown format", psz_fontfile );
|
||||
@@ -369,11 +419,8 @@ static int Create( vlc_object_t *p_this )
|
||||
|
||||
p_sys->i_use_kerning = FT_HAS_KERNING( p_sys->p_face );
|
||||
|
||||
- var_Get( p_filter, "freetype-fontsize", &val );
|
||||
- p_sys->i_default_font_size = val.i_int;
|
||||
if( SetFontSize( p_filter, 0 ) != VLC_SUCCESS ) goto error;
|
||||
|
||||
- free( psz_fontfile );
|
||||
|
||||
p_sys->pp_font_attachments = NULL;
|
||||
p_sys->i_font_attachments = 0;
|
||||
@@ -381,10 +428,13 @@ static int Create( vlc_object_t *p_this )
|
||||
p_filter->pf_render_text = RenderText;
|
||||
#ifdef HAVE_FONTCONFIG
|
||||
p_filter->pf_render_html = RenderHtml;
|
||||
+ FcPatternDestroy( fontmatch );
|
||||
+ FcPatternDestroy( fontpattern );
|
||||
#else
|
||||
p_filter->pf_render_html = NULL;
|
||||
#endif
|
||||
|
||||
+ free( psz_fontfamily );
|
||||
LoadFontsFromAttachments( p_filter );
|
||||
|
||||
return VLC_SUCCESS;
|
@ -1,50 +0,0 @@
|
||||
diff --git a/modules/access/zip/zipstream.c b/modules/access/zip/zipstream.c
|
||||
index 0250312..59b3f74 100644
|
||||
--- a/modules/access/zip/zipstream.c
|
||||
+++ b/modules/access/zip/zipstream.c
|
||||
@@ -205,8 +205,8 @@ int StreamOpen( vlc_object_t *p_this )
|
||||
if( !p_sys->zipFile )
|
||||
{
|
||||
msg_Warn( s, "unable to open file" );
|
||||
- free( p_sys );
|
||||
free( p_sys->fileFunctions );
|
||||
+ free( p_sys );
|
||||
return VLC_EGENERIC;
|
||||
}
|
||||
|
||||
@@ -214,8 +214,8 @@ int StreamOpen( vlc_object_t *p_this )
|
||||
char *psz_tmp;
|
||||
if( asprintf( &psz_tmp, "%s.xspf", s->psz_path ) == -1 )
|
||||
{
|
||||
- free( p_sys );
|
||||
free( p_sys->fileFunctions );
|
||||
+ free( p_sys );
|
||||
return VLC_ENOMEM;
|
||||
}
|
||||
p_sys->psz_path = s->psz_path;
|
||||
@@ -310,7 +310,7 @@ static int Control( stream_t *s, int i_query, va_list args )
|
||||
return VLC_EGENERIC;
|
||||
else
|
||||
{
|
||||
- p_sys->i_len = (size_t) i_position;
|
||||
+ p_sys->i_pos = (size_t) i_position;
|
||||
return VLC_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
|
||||
index 97aca1a..31b990a 100644
|
||||
--- a/modules/gui/qt4/main_interface.cpp
|
||||
+++ b/modules/gui/qt4/main_interface.cpp
|
||||
@@ -1134,8 +1134,8 @@ void MainInterface::dropEventPlay( QDropEvent *event, bool b_play )
|
||||
|
||||
if( s.length() > 0 ) {
|
||||
playlist_Add( THEPL, qtu(s), NULL,
|
||||
- PLAYLIST_APPEND | (first ? PLAYLIST_GO: 0),
|
||||
- PLAYLIST_END, true, false );
|
||||
+ PLAYLIST_APPEND | (first ? PLAYLIST_GO: PLAYLIST_PREPARSE),
|
||||
+ PLAYLIST_END, true, pl_Unlocked );
|
||||
first = false;
|
||||
RecentsMRL::getInstance( p_intf )->addRecent( s );
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
diff -up vlc-1.0.2/modules/access/bd/Modules.am.compiler vlc-1.0.2/modules/access/bd/Modules.am
|
||||
--- vlc-1.0.2/modules/access/bd/Modules.am.compiler 2009-09-18 00:23:37.000000000 +0200
|
||||
+++ vlc-1.0.2/modules/access/bd/Modules.am 2009-09-20 10:35:40.107945580 +0200
|
||||
@@ -8,3 +8,5 @@ SOURCES_access_bd = \
|
||||
|
||||
libvlc_LTLIBRARIES += libaccess_bd_plugin.la
|
||||
|
||||
+libaccess_bd_plugin_la_CFLAGS = -O0
|
||||
+
|
Loading…
Reference in new issue