Commit c31d11bf authored by Max Kellermann's avatar Max Kellermann

decoder/fluidsynth: don't duplicate path

The libfluidsynth now accepts const strings.
parent c8ec85d6
...@@ -99,7 +99,6 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs) ...@@ -99,7 +99,6 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
fluid_settings_t *settings; fluid_settings_t *settings;
fluid_synth_t *synth; fluid_synth_t *synth;
fluid_player_t *player; fluid_player_t *player;
char *path_dup;
int ret; int ret;
enum decoder_command cmd; enum decoder_command cmd;
...@@ -144,11 +143,7 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs) ...@@ -144,11 +143,7 @@ fluidsynth_file_decode(struct decoder *decoder, const char *path_fs)
return; return;
} }
/* temporarily duplicate the path_fs string, because ret = fluid_player_add(player, path_fs);
fluidsynth wants a writable string */
path_dup = g_strdup(path_fs);
ret = fluid_player_add(player, path_dup);
g_free(path_dup);
if (ret != 0) { if (ret != 0) {
g_warning("fluid_player_add() failed"); g_warning("fluid_player_add() failed");
delete_fluid_player(player); delete_fluid_player(player);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment