pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
multimedia/vlc patch for testing
Hi all,
attached patch should fix the i18n usage in VLC for NetBSD/current
properly. Please test and report back.
Joerg
Index: multimedia/vlc/distinfo
==================================================================
--- multimedia/vlc/distinfo
+++ multimedia/vlc/distinfo
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.61 2013/06/15 22:57:58 wiz Exp $
+$NetBSD: distinfo,v 1.60 2013/04/30 09:23:09 prlw1 Exp $
SHA1 (vlc-1.1.13.tar.bz2) = 05bbc7ff427f3b919b29a45ce014caff9ba92648
RMD160 (vlc-1.1.13.tar.bz2) = c5aa438a9085ddbf28e849df442b75475693290d
Size (vlc-1.1.13.tar.bz2) = 26226587 bytes
SHA1 (patch-SA1302) = 9c654eca6f4e689ce2d5c563c6f19dc7705e418b
@@ -13,11 +13,16 @@
SHA1 (patch-ag) = 5e23bac844429632c0dee0dea4ecbdfb5f8ba2fd
SHA1 (patch-ah) = 6d5d5c0e17bd845fad757e75a9e68db698510374
SHA1 (patch-ai) = 328bd66ef6c11275894c74012e7d6fec8fcbd5d3
SHA1 (patch-ar) = 153164870e9dc50ad32106d9f8ebd25b35ed3dd3
SHA1 (patch-as) = b53b074b2791d7bf69d5f09c7c32d873608f3086
-SHA1 (patch-at) = c87d63d438296653bc1bf234452fb48dbb0547e5
+SHA1 (patch-at) = d4fe7ba15a64c28f97a2800fe0bcae304ce0fa2d
SHA1 (patch-au) = 7e1d1e7f2734051fffb988cc4ea01a1a7b264b78
SHA1 (patch-configure.ac) = db79a1e99bf2859eeb2615359db9a30a3eadfb2d
-SHA1 (patch-include_vlc_fixups.h) = 0e17c6749665b4f95bc13a0aff0bc8af9e942c9d
+SHA1 (patch-include_vlc__fixups.h) = b6001b92238e365ccd8e5daf3683f919e472b61d
SHA1 (patch-modules_audio__output_pulse.c) =
994389b214f3e2b7b8b7ccaf3bb535a94523f81b
SHA1 (patch-modules_codec_flac.c) = 962783164f505a8b9e5c1be18e162dfdc7917cb3
+SHA1 (patch-modules_misc_rtsp.c) = 586e0228cf21ca2f976451e61e4390278afb6fee
+SHA1 (patch-modules_visualization_projectm.cpp) =
8e3c6ec0d9588f432c5baa75e36c1c2248780b6b
+SHA1 (patch-src_config_file.c) = f6938d98f0f9b14cd13f8020807aac3c818c58d1
+SHA1 (patch-src_misc_messages.c) = 855e82349ec80f7d68404da6b40f367776a74327
+SHA1 (patch-src_text_charset.c) = b8dfc376f23655565f671849971293d8527f5e3e
Index: multimedia/vlc/patches/patch-at
==================================================================
--- multimedia/vlc/patches/patch-at
+++ multimedia/vlc/patches/patch-at
@@ -1,8 +1,8 @@
$NetBSD: patch-at,v 1.2 2013/06/15 22:57:58 wiz Exp $
---- bin/override.c.orig 2013-06-15 22:57:03.000000000 +0000
+--- bin/override.c.orig 2013-05-15 20:23:06.000000000 +0000
+++ bin/override.c
@@ -27,7 +27,7 @@
void vlc_enable_override (void);
@@ -18,5 +18,21 @@
-int putenv (char *str)
+int putenv (const char *str)
{
if (override)
{
+@@ -245,6 +245,7 @@ error:
+ */
+ #include <locale.h>
+
++#if 0
+ char *setlocale (int cat, const char *locale)
+ {
+ if (override && locale != NULL)
+@@ -254,6 +255,7 @@ char *setlocale (int cat, const char *lo
+ }
+ return CALL(setlocale, cat, locale);
+ }
++#endif
+
+
+ /*** Xlib ****/
ADDED multimedia/vlc/patches/patch-include_vlc__fixups.h
Index: multimedia/vlc/patches/patch-include_vlc__fixups.h
==================================================================
--- multimedia/vlc/patches/patch-include_vlc__fixups.h
+++ multimedia/vlc/patches/patch-include_vlc__fixups.h
@@ -0,0 +1,31 @@
+$NetBSD$
+
+--- include/vlc_fixups.h.orig 2013-05-15 20:39:43.000000000 +0000
++++ include/vlc_fixups.h
+@@ -177,25 +177,7 @@ static inline char *getenv (const char *
+ # define ATTR_ALIGN(align)
+ #endif
+
+-#ifndef HAVE_USELOCALE
+-#define LC_NUMERIC_MASK 0
+-#define LC_MESSAGES_MASK 0
+-typedef void *locale_t;
+-static inline locale_t uselocale(locale_t loc)
+-{
+- (void)loc;
+- return NULL;
+-}
+-static inline void freelocale(locale_t loc)
+-{
+- (void)loc;
+-}
+-static inline locale_t newlocale(int mask, const char * locale, locale_t base)
+-{
+- (void)mask; (void)locale; (void)base;
+- return NULL;
+-}
+-#endif
++#include <locale.h>
+
+ #ifdef WIN32
+ # include <dirent.h>
DELETED multimedia/vlc/patches/patch-include_vlc_fixups.h
Index: multimedia/vlc/patches/patch-include_vlc_fixups.h
==================================================================
ADDED multimedia/vlc/patches/patch-modules_misc_rtsp.c
Index: multimedia/vlc/patches/patch-modules_misc_rtsp.c
==================================================================
--- multimedia/vlc/patches/patch-modules_misc_rtsp.c
+++ multimedia/vlc/patches/patch-modules_misc_rtsp.c
@@ -0,0 +1,33 @@
+$NetBSD$
+
+--- modules/misc/rtsp.c.orig 2013-05-15 20:28:04.000000000 +0000
++++ modules/misc/rtsp.c
+@@ -952,22 +952,26 @@ static void RtspClientDel( vod_media_t *
+
+ static float ParseNPT (const char *str)
+ {
++#ifndef LC_C_LOCALE
+ locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
+ locale_t oldloc = uselocale (loc);
++#endif
+ unsigned hour, min;
+ float sec;
+
+- if (sscanf (str, "%u:%u:%f", &hour, &min, &sec) == 3)
++ if (sscanf_l (str, LC_C_LOCALE, "%u:%u:%f", &hour, &min, &sec) == 3)
+ sec += ((hour * 60) + min) * 60;
+ else
+- if (sscanf (str, "%f", &sec) != 1)
++ if (sscanf_l (str, LC_C_LOCALE, "%f", &sec) != 1)
+ sec = 0.;
+
++#ifndef LC_C_LOCALE
+ if (loc != (locale_t)0)
+ {
+ uselocale (oldloc);
+ freelocale (loc);
+ }
++#endif
+ return sec;
+ }
+
ADDED multimedia/vlc/patches/patch-modules_visualization_projectm.cpp
Index: multimedia/vlc/patches/patch-modules_visualization_projectm.cpp
==================================================================
--- multimedia/vlc/patches/patch-modules_visualization_projectm.cpp
+++ multimedia/vlc/patches/patch-modules_visualization_projectm.cpp
@@ -0,0 +1,29 @@
+$NetBSD$
+
+--- modules/visualization/projectm.cpp.orig 2013-05-15 20:28:01.000000000
+0000
++++ modules/visualization/projectm.cpp
+@@ -344,8 +344,10 @@ static void *Thread( void *p_data )
+ goto error;
+ }
+
++#ifndef LC_C_LOCALE
+ loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
+ oldloc = uselocale (loc);
++#endif
+ /* Create the projectM object */
+ #ifndef HAVE_PROJECTM2
+ psz_config = var_InheritString( p_filter, "projectm-config" );
+@@ -428,11 +430,13 @@ static void *Thread( void *p_data )
+ delete p_projectm;
+ vout_DeleteDisplay( p_sys->p_vd, NULL );
+ vlc_object_release( p_sys->p_vout );
++#ifndef LC_C_LOCALE
+ if (loc != (locale_t)0)
+ {
+ uselocale (oldloc);
+ freelocale (loc);
+ }
++#endif
+ return NULL;
+ }
+ vlc_mutex_unlock( &p_sys->lock );
ADDED multimedia/vlc/patches/patch-src_config_file.c
Index: multimedia/vlc/patches/patch-src_config_file.c
==================================================================
--- multimedia/vlc/patches/patch-src_config_file.c
+++ multimedia/vlc/patches/patch-src_config_file.c
@@ -0,0 +1,63 @@
+$NetBSD$
+
+--- src/config/file.c.orig 2013-05-15 20:27:58.000000000 +0000
++++ src/config/file.c
+@@ -187,8 +187,10 @@ int config_LoadConfigFile( vlc_object_t
+ section[0] = '\0';
+
+ /* Ensure consistent number formatting... */
++#ifndef LC_C_LOCALE
+ locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
+ locale_t baseloc = uselocale (loc);
++#endif
+
+ vlc_rwlock_wrlock (&config_lock);
+ while (fgets (line, 1024, file) != NULL)
+@@ -282,7 +284,7 @@ int config_LoadConfigFile( vlc_object_t
+ case CONFIG_ITEM_FLOAT:
+ if( !*psz_option_value )
+ break; /* ignore empty option */
+- p_item->value.f = (float)atof (psz_option_value);
++ p_item->value.f = strtof_l(psz_option_value, NULL,
LC_C_LOCALE);
+ p_item->saved.f = p_item->value.f;
+ break;
+
+@@ -315,11 +317,13 @@ int config_LoadConfigFile( vlc_object_t
+ fclose (file);
+
+ module_list_free (list);
++#ifndef LC_C_LOCALE
+ if (loc != (locale_t)0)
+ {
+ uselocale (baseloc);
+ freelocale (loc);
+ }
++#endif
+ return 0;
+ }
+
+@@ -570,8 +574,10 @@ static int SaveConfigFile( vlc_object_t
+ "\n" );
+
+ /* Ensure consistent number formatting... */
++#ifndef LC_C_LOCALE
+ locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
+ locale_t baseloc = uselocale (loc);
++#endif
+
+ /* We would take the config lock here. But this would cause a lock
+ * inversion with the serializer above and config_AutoSaveConfigFile().
+@@ -683,11 +689,13 @@ static int SaveConfigFile( vlc_object_t
+ vlc_rwlock_unlock (&config_lock);
+
+ module_list_free (list);
++#ifndef LC_C_LOCALE
+ if (loc != (locale_t)0)
+ {
+ uselocale (baseloc);
+ freelocale (loc);
+ }
++#endif
+
+ /*
+ * Restore old settings from the config in file
ADDED multimedia/vlc/patches/patch-src_misc_messages.c
Index: multimedia/vlc/patches/patch-src_misc_messages.c
==================================================================
--- multimedia/vlc/patches/patch-src_misc_messages.c
+++ multimedia/vlc/patches/patch-src_misc_messages.c
@@ -0,0 +1,65 @@
+$NetBSD$
+
+--- src/misc/messages.c.orig 2010-08-08 17:32:50.000000000 +0000
++++ src/misc/messages.c
+@@ -301,7 +301,9 @@ void msg_GenericVa (vlc_object_t *p_this
+ return;
+
+ msg_bank_t *bank = libvlc_bank (p_this->p_libvlc);
++#ifndef LC_C_LOCALE
+ locale_t locale = uselocale (bank->locale);
++#endif
+
+ #ifndef __GLIBC__
+ /* Expand %m to strerror(errno) - only once */
+@@ -321,7 +323,9 @@ void msg_GenericVa (vlc_object_t *p_this
+ char errbuf[2001];
+ size_t errlen;
+
+-#ifndef WIN32
++#ifdef LC_C_LOCALE
++ strncpy(errbuf, strerror_l( errno, bank->locale), 1001);
++#elif !defined(WIN32)
+ strerror_r( errno, errbuf, 1001 );
+ #else
+ int sockerr = WSAGetLastError( );
+@@ -361,7 +365,7 @@ void msg_GenericVa (vlc_object_t *p_this
+
+ /* Convert message to string */
+ vlc_va_copy( args, _args );
+- if( vasprintf( &psz_str, psz_format, args ) == -1 )
++ if( vasprintf_l( &psz_str, bank->locale, psz_format, args ) == -1 )
+ psz_str = NULL;
+ va_end( args );
+
+@@ -372,7 +376,9 @@ void msg_GenericVa (vlc_object_t *p_this
+ fprintf( stderr, "main warning: can't store message (%m): " );
+ #else
+ char psz_err[1001];
+-#ifndef WIN32
++#ifdef LC_C_LOCALE
++ strncpy(psz_err, strerror_l( errno, bank->locale), 1001 );
++#elif !defined(WIN32)
+ /* we're not using GLIBC, so we are sure that the error description
+ * will be stored in the buffer we provide to strerror_r() */
+ strerror_r( errno, psz_err, 1001 );
+@@ -384,14 +390,18 @@ void msg_GenericVa (vlc_object_t *p_this
+ #endif
+ vlc_va_copy( args, _args );
+ /* We should use utf8_vfprintf - but it calls malloc()... */
+- vfprintf( stderr, psz_format, args );
++ vfprintf_l( stderr, bank->locale, psz_format, args );
+ va_end( args );
+ fputs( "\n", stderr );
+ vlc_restorecancel (canc);
++#ifndef LC_C_LOCALE
+ uselocale (locale);
++#endif
+ return;
+ }
++#ifndef LC_C_LOCALE
+ uselocale (locale);
++#endif
+
+ msg_item_t * p_item = malloc (sizeof (*p_item));
+ if (p_item == NULL)
ADDED multimedia/vlc/patches/patch-src_text_charset.c
Index: multimedia/vlc/patches/patch-src_text_charset.c
==================================================================
--- multimedia/vlc/patches/patch-src_text_charset.c
+++ multimedia/vlc/patches/patch-src_text_charset.c
@@ -0,0 +1,61 @@
+$NetBSD$
+
+--- src/text/charset.c.orig 2013-05-15 20:27:52.000000000 +0000
++++ src/text/charset.c
+@@ -78,6 +78,9 @@ char *vlc_fix_readdir( const char *psz_s
+ */
+ double us_strtod( const char *str, char **end )
+ {
++#ifdef LC_C_LOCALE
++ return strtod_l(str, end, LC_C_LOCALE);
++#else
+ locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
+ locale_t oldloc = uselocale (loc);
+ double res = strtod (str, end);
+@@ -88,6 +91,7 @@ double us_strtod( const char *str, char
+ freelocale (loc);
+ }
+ return res;
++#endif
+ }
+
+
+@@ -97,6 +101,9 @@ double us_strtod( const char *str, char
+ */
+ float us_strtof( const char *str, char **end )
+ {
++#ifdef LC_C_LOCALE
++ return strtof_l(str, end, LC_C_LOCALE);
++#else
+ locale_t loc = newlocale (LC_NUMERIC_MASK, "C", NULL);
+ locale_t oldloc = uselocale (loc);
+ float res = strtof (str, end);
+@@ -107,6 +114,7 @@ float us_strtof( const char *str, char *
+ freelocale (loc);
+ }
+ return res;
++#endif
+ }
+
+
+@@ -126,6 +134,14 @@ double us_atof( const char *str )
+ */
+ int us_asprintf( char **ret, const char *format, ... )
+ {
++#ifdef LC_C_LOCALE
++ va_list ap;
++ int i_rc;
++ va_start( ap, format );
++ i_rc = vasprintf_l( ret, LC_C_LOCALE, format, ap );
++ va_end( ap );
++ return i_rc;
++#else
+ va_list ap;
+ locale_t loc = newlocale( LC_NUMERIC_MASK, "C", NULL );
+ locale_t oldloc = uselocale( loc );
+@@ -142,4 +158,5 @@ int us_asprintf( char **ret, const char
+ }
+
+ return i_rc;
++#endif
+ }
Home |
Main Index |
Thread Index |
Old Index