diff --git a/lib/audio.cpp b/lib/audio.cpp index 8e8b0623..afa57ce4 100644 --- a/lib/audio.cpp +++ b/lib/audio.cpp @@ -83,7 +83,7 @@ static bool change_state(GstState state) static bool load_song(library :: Song &song) { GstState state; - gchar *escaped; + gchar *escaped, *uri; std::string filepath = song.library->root_path + "/" + song.track->filepath; if (o_should_pause == true) { @@ -95,9 +95,11 @@ static bool load_song(library :: Song &song) } change_state(GST_STATE_NULL); - escaped = gst_filename_to_uri(filepath.c_str(), NULL); - g_object_set(G_OBJECT(ocarina_player), "uri", escaped, NULL); + escaped = g_markup_escape_text(filepath.c_str(), filepath.size()); + uri = gst_filename_to_uri(escaped, NULL); + g_object_set(G_OBJECT(ocarina_player), "uri", uri, NULL); g_free(escaped); + g_free(uri); get_callbacks()->on_track_loaded(song); return change_state(state);