aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-19 17:46:00 +0200
committerMax Kellermann <max@duempel.org>2013-10-19 17:46:00 +0200
commit1373d40fead4a465525c7a0b7a286d271e24d793 (patch)
treedb1b592f4404ec0dd9328cef23c65c36a080723a /src
parent3274bb54ad673cfd9d9ab6d6d86e5cebaadf89f2 (diff)
downloadmpd-1373d40fead4a465525c7a0b7a286d271e24d793.tar.gz
mpd-1373d40fead4a465525c7a0b7a286d271e24d793.tar.xz
mpd-1373d40fead4a465525c7a0b7a286d271e24d793.zip
decoder/mpg123: use const_cast instead of g_strdup()
Diffstat (limited to '')
-rw-r--r--src/decoder/Mpg123DecoderPlugin.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/decoder/Mpg123DecoderPlugin.cxx b/src/decoder/Mpg123DecoderPlugin.cxx
index 928af39e6..524716d06 100644
--- a/src/decoder/Mpg123DecoderPlugin.cxx
+++ b/src/decoder/Mpg123DecoderPlugin.cxx
@@ -60,16 +60,14 @@ static bool
mpd_mpg123_open(mpg123_handle *handle, const char *path_fs,
AudioFormat &audio_format)
{
- char *path_dup;
int error;
int channels, encoding;
long rate;
/* 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);
- g_free(path_dup);
+ error = mpg123_open(handle, path2);
if (error != MPG123_OK) {
FormatWarning(mpg123_domain,
"libmpg123 failed to open %s: %s",