Commit 1373d40f authored by Max Kellermann's avatar Max Kellermann

decoder/mpg123: use const_cast instead of g_strdup()

parent 3274bb54
...@@ -60,16 +60,14 @@ static bool ...@@ -60,16 +60,14 @@ static bool
mpd_mpg123_open(mpg123_handle *handle, const char *path_fs, mpd_mpg123_open(mpg123_handle *handle, const char *path_fs,
AudioFormat &audio_format) AudioFormat &audio_format)
{ {
char *path_dup;
int error; int error;
int channels, encoding; int channels, encoding;
long rate; long rate;
/* mpg123_open() wants a writable string :-( */ /* mpg123_open() wants a writable string :-( */
path_dup = g_strdup(path_fs); char *const path2 = const_cast<char *>(path_fs);
error = mpg123_open(handle, path_dup); error = mpg123_open(handle, path2);
g_free(path_dup);
if (error != MPG123_OK) { if (error != MPG123_OK) {
FormatWarning(mpg123_domain, FormatWarning(mpg123_domain,
"libmpg123 failed to open %s: %s", "libmpg123 failed to open %s: %s",
......
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