- mlt_properties_set( MLT_PLAYLIST_PROPERTIES( this ), "eof", "pause" );
- mlt_properties_set( MLT_PLAYLIST_PROPERTIES( this ), "resource", "<playlist>" );
- mlt_properties_set( MLT_PLAYLIST_PROPERTIES( this ), "mlt_type", "mlt_producer" );
- mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( this ), "in", 0 );
- mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( this ), "out", -1 );
- mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( this ), "length", 0 );
-
- this->size = 10;
- this->list = malloc( this->size * sizeof( playlist_entry * ) );
+ mlt_properties_set( MLT_PLAYLIST_PROPERTIES( self ), "eof", "pause" );
+ mlt_properties_set( MLT_PLAYLIST_PROPERTIES( self ), "resource", "<playlist>" );
+ mlt_properties_set( MLT_PLAYLIST_PROPERTIES( self ), "mlt_type", "mlt_producer" );
+ mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( self ), "in", 0 );
+ mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( self ), "out", -1 );
+ mlt_properties_set_position( MLT_PLAYLIST_PROPERTIES( self ), "length", 0 );
+
+ self->size = 10;
+ self->list = calloc( self->size, sizeof( playlist_entry * ) );
+ if ( self->list == NULL ) goto error2;
+
+ mlt_events_register( MLT_PLAYLIST_PROPERTIES( self ), "playlist-next", (mlt_transmitter) mlt_playlist_next );