static inline void mlt_properties_do_mirror( mlt_properties self, const char *name )
{
+ if ( !self ) return;
property_list *list = self->local;
if ( list->mirror != NULL )
{
void mlt_properties_mirror( mlt_properties self, mlt_properties that )
{
+ if ( !self ) return;
property_list *list = self->local;
list->mirror = that;
}
* \public \memberof mlt_properties_s
* \param self The properties to copy to
* \param that The properties to copy from
- * \return false
+ * \return true if error
*/
int mlt_properties_inherit( mlt_properties self, mlt_properties that )
{
+ if ( !self || !that ) return 1;
int count = mlt_properties_count( that );
int i = 0;
for ( i = 0; i < count; i ++ )
* \param self the properties to copy to
* \param that The properties to copy from
* \param prefix the property names to match (required)
- * \return false
+ * \return true if error
*/
int mlt_properties_pass( mlt_properties self, mlt_properties that, const char *prefix )
{
+ if ( !self || !that ) return 1;
int count = mlt_properties_count( that );
int length = strlen( prefix );
int i = 0;
static inline mlt_property mlt_properties_find( mlt_properties self, const char *name )
{
- if ( !name ) return NULL;
+ if ( !self || !name ) return NULL;
property_list *list = self->local;
mlt_property value = NULL;
int key = generate_hash( name );
* \param self the properties to copy to
* \param that the properties to copy from
* \param list a delimited list of property names
- * \return false
+ * \return true if error
*/
int mlt_properties_pass_list( mlt_properties self, mlt_properties that, const char *list )
{
+ if ( !self || !that || !list ) return 1;
char *props = strdup( list );
char *ptr = props;
const char *delim = " ,\t\n"; // Any combination of spaces, commas, tabs, and newlines
{
int error = 1;
+ if ( !self || !name ) return error;
+
// Fetch the property to work with
mlt_property property = mlt_properties_fetch( self, name );
char *mlt_properties_get_name( mlt_properties self, int index )
{
+ if ( !self ) return NULL;
property_list *list = self->local;
if ( index >= 0 && index < list->count )
return list->name[ index ];
char *mlt_properties_get_value( mlt_properties self, int index )
{
+ if ( !self ) return NULL;
property_list *list = self->local;
if ( index >= 0 && index < list->count )
return mlt_property_get_string_l( list->value[ index ], list->locale );
void *mlt_properties_get_data_at( mlt_properties self, int index, int *size )
{
+ if ( !self ) return NULL;
property_list *list = self->local;
if ( index >= 0 && index < list->count )
return mlt_property_get_data( list->value[ index ], size );
*
* \public \memberof mlt_properties_s
* \param self a properties list
- * \return the number of property objects
+ * \return the number of property objects or -1 if error
*/
int mlt_properties_count( mlt_properties self )
{
+ if ( !self ) return -1;
property_list *list = self->local;
return list->count;
}
int mlt_properties_parse( mlt_properties self, const char *namevalue )
{
+ if ( !self ) return 1;
char *name = strdup( namevalue );
char *value = NULL;
int error = 0;
{
int error = 1;
+ if ( !self || !name ) return error;
+
// Fetch the property to work with
mlt_property property = mlt_properties_fetch( self, name );
{
int error = 1;
+ if ( !self || !name ) return error;
+
// Fetch the property to work with
mlt_property property = mlt_properties_fetch( self, name );
{
int error = 1;
+ if ( !self || !name ) return error;
+
// Fetch the property to work with
mlt_property property = mlt_properties_fetch( self, name );
{
int error = 1;
+ if ( !self || !name ) return error;
+
// Fetch the property to work with
mlt_property property = mlt_properties_fetch( self, name );
{
int error = 1;
+ if ( !self || !name ) return error;
+
// Fetch the property to work with
mlt_property property = mlt_properties_fetch( self, name );
void mlt_properties_dump( mlt_properties self, FILE *output )
{
+ if ( !self || !output ) return;
property_list *list = self->local;
int i = 0;
for ( i = 0; i < list->count; i ++ )
*/
void mlt_properties_debug( mlt_properties self, const char *title, FILE *output )
{
+ if ( !self || !output ) return;
if ( output == NULL ) output = stderr;
fprintf( output, "%s: ", title );
if ( self != NULL )
int mlt_properties_save( mlt_properties self, const char *filename )
{
int error = 1;
+ if ( !self || !filename ) return error;
FILE *f = fopen( filename, "w" );
if ( f != NULL )
{
char *mlt_properties_serialise_yaml( mlt_properties self )
{
+ if ( !self ) return NULL;
const char *lc_numeric = mlt_properties_get_lcnumeric( self );
strbuf b = strbuf_new();
strbuf_printf( b, "---\n" );