- msg_Dbg( p_playlist, "saving %s to file %s",
- p_export_root->p_input->psz_name, psz_filename );
-
- /* Prepare the playlist_export_t structure */
- export.psz_filename = psz_filename ? strdup( psz_filename ) : NULL;
- export.p_file = utf8_fopen( psz_filename, "wt" );
- if( export.p_file == NULL )
- {
- msg_Err( p_playlist , "could not create playlist file %s (%m)",
- psz_filename );
- free( export.psz_filename );
- return VLC_EGENERIC;
- }
+ playlist_export_t *p_export =
+ vlc_custom_create( p_playlist, sizeof( *p_export ), VLC_OBJECT_GENERIC,
+ "playlist export" );
+ if( !p_export )
+ return VLC_ENOMEM;