mlt: update to 6.8.0.

the musl patch is not needed anymore, instead HAVE_STRTOD_L and
HAVE_LOCALE_H have to be set to 1
This commit is contained in:
Johannes Brechtmann 2018-05-20 01:33:01 +02:00 committed by maxice8
parent 635ee8a5ff
commit 788e600fc3
2 changed files with 7 additions and 267 deletions

View file

@ -1,263 +0,0 @@
Remove the wrong assumptions that if __GLIBC__ isn't defined,
then strtod_l() would not exist. It exists with musl libc as well.
Also don't assume locale_t == char* if __GLIBC__ isn't defined.
--- src/framework/mlt_properties.c 2018-01-23 07:41:00.000000000 +0100
+++ src/framework/mlt_properties.c 2018-01-25 17:49:25.604808390 +0100
@@ -141,15 +141,9 @@ int mlt_properties_set_lcnumeric( mlt_pr
{
property_list *list = self->local;
-#if defined(__GLIBC__) || defined(__APPLE__)
if ( list->locale )
freelocale( list->locale );
list->locale = newlocale( LC_NUMERIC_MASK, locale, NULL );
-#else
-
- free( list->locale );
- list->locale = strdup( locale );
-#endif
}
else
error = 1;
@@ -181,7 +175,7 @@ const char* mlt_properties_get_lcnumeric
#elif defined(__GLIBC__)
result = list->locale->__names[ LC_NUMERIC ];
#else
- result = list->locale;
+ result = "C";
#endif
#if defined(_WIN32)
if ( result )
@@ -713,12 +707,10 @@ int mlt_properties_set( mlt_properties s
// Determine the value
if ( isdigit( id[ 0 ] ) )
{
-#if defined(__GLIBC__) || defined(__APPLE__)
property_list *list = self->local;
if ( list->locale )
current = strtod_l( id, NULL, list->locale );
else
-#endif
current = strtod( id, NULL );
}
else
@@ -1404,14 +1396,9 @@ void mlt_properties_close( mlt_propertie
free( list->name[ index ] );
}
-#if defined(__GLIBC__) || defined(__APPLE__)
// Cleanup locale
if ( list->locale )
freelocale( list->locale );
-#else
-
- free( list->locale );
-#endif
// Clear up the list
pthread_mutex_destroy( &list->mutex );
--- src/framework/mlt_property.c 2018-01-23 07:41:00.000000000 +0100
+++ src/framework/mlt_property.c 2018-01-25 17:45:17.343812836 +0100
@@ -278,27 +278,10 @@ static int time_clock_to_frames( mlt_pro
s = copy;
pos = strrchr( s, ':' );
-#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32)
- char *orig_localename = NULL;
- if ( locale )
- {
- // Protect damaging the global locale from a temporary locale on another thread.
- pthread_mutex_lock( &self->mutex );
-
- // Get the current locale
- orig_localename = strdup( setlocale( LC_NUMERIC, NULL ) );
-
- // Set the new locale
- setlocale( LC_NUMERIC, locale );
- }
-#endif
-
if ( pos ) {
-#if defined(__GLIBC__) || defined(__APPLE__)
if ( locale )
seconds = strtod_l( pos + 1, NULL, locale );
else
-#endif
seconds = strtod( pos + 1, NULL );
*pos = 0;
pos = strrchr( s, ':' );
@@ -312,23 +295,12 @@ static int time_clock_to_frames( mlt_pro
}
}
else {
-#if defined(__GLIBC__) || defined(__APPLE__)
if ( locale )
seconds = strtod_l( s, NULL, locale );
else
-#endif
seconds = strtod( s, NULL );
}
-#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32)
- if ( locale ) {
- // Restore the current locale
- setlocale( LC_NUMERIC, orig_localename );
- free( orig_localename );
- pthread_mutex_unlock( &self->mutex );
- }
-#endif
-
free( copy );
return floor( fps * hours * 3600 ) + floor( fps * minutes * 60 ) + lrint( fps * seconds );
@@ -407,7 +379,7 @@ static int time_code_to_frames( mlt_prop
static int mlt_property_atoi( mlt_property self, double fps, locale_t locale )
{
const char *value = self->prop_string;
-
+
// Parse a hex color value as #RRGGBB or #AARRGGBB.
if ( value[0] == '#' )
{
@@ -489,37 +461,13 @@ static double mlt_property_atof( mlt_pro
char *end = NULL;
double result;
-#if defined(__GLIBC__) || defined(__APPLE__)
if ( locale )
result = strtod_l( value, &end, locale );
else
-#elif !defined(_WIN32)
- char *orig_localename = NULL;
- if ( locale ) {
- // Protect damaging the global locale from a temporary locale on another thread.
- pthread_mutex_lock( &self->mutex );
-
- // Get the current locale
- orig_localename = strdup( setlocale( LC_NUMERIC, NULL ) );
-
- // Set the new locale
- setlocale( LC_NUMERIC, locale );
- }
-#endif
-
result = strtod( value, &end );
if ( end && end[0] == '%' )
result /= 100.0;
-#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32)
- if ( locale ) {
- // Restore the current locale
- setlocale( LC_NUMERIC, orig_localename );
- free( orig_localename );
- pthread_mutex_unlock( &self->mutex );
- }
-#endif
-
return result;
}
}
@@ -1030,36 +978,11 @@ static int is_property_numeric( mlt_prop
{
double temp;
char *p = NULL;
-
-#if defined(__GLIBC__) || defined(__APPLE__)
+
if ( locale )
temp = strtod_l( self->prop_string, &p, locale );
else
-#elif !defined(_WIN32)
- char *orig_localename = NULL;
- if ( locale ) {
- // Protect damaging the global locale from a temporary locale on another thread.
- pthread_mutex_lock( &self->mutex );
-
- // Get the current locale
- orig_localename = strdup( setlocale( LC_NUMERIC, NULL ) );
-
- // Set the new locale
- setlocale( LC_NUMERIC, locale );
- }
-#endif
-
- temp = strtod( self->prop_string, &p );
-
-#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32)
- if ( locale ) {
- // Restore the current locale
- setlocale( LC_NUMERIC, orig_localename );
- free( orig_localename );
- pthread_mutex_unlock( &self->mutex );
- }
-#endif
-
+ temp = strtod( self->prop_string, &p );
result = ( p != self->prop_string );
}
return result;
@@ -1535,28 +1458,12 @@ mlt_rect mlt_property_get_rect( mlt_prop
char *p = NULL;
int count = 0;
-#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32)
- char *orig_localename = NULL;
- if ( locale ) {
- // Protect damaging the global locale from a temporary locale on another thread.
- pthread_mutex_lock( &self->mutex );
-
- // Get the current locale
- orig_localename = strdup( setlocale( LC_NUMERIC, NULL ) );
-
- // Set the new locale
- setlocale( LC_NUMERIC, locale );
- }
-#endif
-
while ( *value )
{
double temp;
-#if defined(__GLIBC__) || defined(__APPLE__)
if ( locale )
temp = strtod_l( value, &p, locale );
else
-#endif
temp = strtod( value, &p );
if ( p != value )
{
@@ -1586,15 +1493,6 @@ mlt_rect mlt_property_get_rect( mlt_prop
value = p;
count ++;
}
-
-#if !defined(__GLIBC__) && !defined(__APPLE__) && !defined(_WIN32)
- if ( locale ) {
- // Restore the current locale
- setlocale( LC_NUMERIC, orig_localename );
- free( orig_localename );
- pthread_mutex_unlock( &self->mutex );
- }
-#endif
}
return rect;
}
--- src/framework/mlt_property.h 2018-01-23 07:41:00.000000000 +0100
+++ src/framework/mlt_property.h 2018-01-25 18:01:15.393795679 +0100
@@ -30,13 +30,7 @@
#include <sys/param.h>
#endif
-#if defined(__GLIBC__) && !defined(__APPLE__)
# include <locale.h>
-#elif defined(__APPLE__) || (__FreeBSD_version >= 900506)
-# include <xlocale.h>
-#else
-typedef char* locale_t;
-#endif
extern mlt_property mlt_property_init( );
extern int mlt_property_set_int( mlt_property self, int value );

View file

@ -1,6 +1,6 @@
# Template file for 'mlt'
pkgname=mlt
version=6.6.0
version=6.8.0
revision=1
build_style=gnu-configure
configure_args="--enable-gpl --enable-gpl3 --disable-swfdec --without-kde
@ -13,11 +13,14 @@ makedepends="alsa-lib-devel ffmpeg-devel gtk+-devel jack-devel ladspa-sdk
libvidstab-devel"
depends="mlt-data>=${version}_${revision} ladspa-sdk-example-plugins"
short_desc="Multimedia framework, designed for television broadcasting"
license="GPL-3.0-or-later, LGPL-2.1-or-later"
maintainer="Diogo Leal <diogo@diogoleal.com>"
license="GPL-3"
homepage="http://mltframework.org/"
homepage="https://mltframework.org/"
distfiles="https://github.com/mltframework/mlt/archive/v${version}.tar.gz"
checksum=11515546516b3c54719b6b402cacf46e8d5172450d6e9fe2655b237582490315
checksum=b348e7a14d289087a99b077480a28dace519f665af9654676b7f5e713d56f0fe
CFLAGS+=" -DHAVE_STRTOD_L=1 -DHAVE_LOCALE_H=1"
CXXFLAGS+=" -DHAVE_STRTOD_L=1 -DHAVE_LOCALE_H=1"
if [ -n "$CROSS_BUILD" ]; then
make_build_args="CROSS=${XBPS_CROSS_TRIPLET}-"