diff options
author | Max Kellermann <max@duempel.org> | 2013-01-28 23:41:45 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-28 23:41:45 +0100 |
commit | 76417d44464248949e7843eee0d5338a8e0a22ac (patch) | |
tree | c8f6416505b7268ce4f3902660ba35f4e35d1c04 /src/InputStream.cxx | |
parent | cffc78ad6a978c8ef0afae4fbdd4b189612a7167 (diff) | |
download | mpd-76417d44464248949e7843eee0d5338a8e0a22ac.tar.gz mpd-76417d44464248949e7843eee0d5338a8e0a22ac.tar.xz mpd-76417d44464248949e7843eee0d5338a8e0a22ac.zip |
InputStream: use std::string
Diffstat (limited to '')
-rw-r--r-- | src/InputStream.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/InputStream.cxx b/src/InputStream.cxx index ef77a468d..913fcf637 100644 --- a/src/InputStream.cxx +++ b/src/InputStream.cxx @@ -115,7 +115,7 @@ input_stream_get_mime_type(const struct input_stream *is) assert(is != NULL); assert(is->ready); - return is->mime; + return is->mime.empty() ? nullptr : is->mime.c_str(); } void @@ -124,8 +124,7 @@ input_stream_override_mime_type(struct input_stream *is, const char *mime) assert(is != NULL); assert(is->ready); - g_free(is->mime); - is->mime = g_strdup(mime); + is->mime = mime; } goffset @@ -158,7 +157,7 @@ input_stream_is_seekable(const struct input_stream *is) bool input_stream_cheap_seeking(const struct input_stream *is) { - return is->seekable && (is->uri == NULL || !uri_has_scheme(is->uri)); + return is->seekable && !uri_has_scheme(is->uri.c_str()); } bool |