diff options
author | Max Kellermann <max@duempel.org> | 2013-01-24 19:14:40 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-26 01:24:01 +0100 |
commit | 0273cd44b0b50d5d320ce88cc1472e0d8ee8e529 (patch) | |
tree | 7c493850ab07deddd637ca0b5e8b3476e40a68fc /src/PlaylistRegistry.cxx | |
parent | 3203a7dd8ce8db6afcc54d68d63b4f4af7dc4c7f (diff) | |
download | mpd-0273cd44b0b50d5d320ce88cc1472e0d8ee8e529.tar.gz mpd-0273cd44b0b50d5d320ce88cc1472e0d8ee8e529.tar.xz mpd-0273cd44b0b50d5d320ce88cc1472e0d8ee8e529.zip |
input_stream: forward-declare the struct
Hide the definition from C code, to prepare the transition to C++.
Diffstat (limited to 'src/PlaylistRegistry.cxx')
-rw-r--r-- | src/PlaylistRegistry.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/PlaylistRegistry.cxx b/src/PlaylistRegistry.cxx index f919f388b..1e9edd443 100644 --- a/src/PlaylistRegistry.cxx +++ b/src/PlaylistRegistry.cxx @@ -233,19 +233,19 @@ playlist_list_open_stream_mime2(struct input_stream *is, const char *mime) } static struct playlist_provider * -playlist_list_open_stream_mime(struct input_stream *is) +playlist_list_open_stream_mime(struct input_stream *is, const char *full_mime) { - assert(is->mime != NULL); + assert(full_mime != NULL); - const char *semicolon = strchr(is->mime, ';'); + const char *semicolon = strchr(full_mime, ';'); if (semicolon == NULL) - return playlist_list_open_stream_mime2(is, is->mime); + return playlist_list_open_stream_mime2(is, full_mime); - if (semicolon == is->mime) + if (semicolon == full_mime) return NULL; /* probe only the portion before the semicolon*/ - char *mime = g_strndup(is->mime, semicolon - is->mime); + char *mime = g_strndup(full_mime, semicolon - full_mime); struct playlist_provider *playlist = playlist_list_open_stream_mime2(is, mime); g_free(mime); @@ -285,8 +285,9 @@ playlist_list_open_stream(struct input_stream *is, const char *uri) input_stream_lock_wait_ready(is); - if (is->mime != NULL) { - playlist = playlist_list_open_stream_mime(is); + const char *const mime = input_stream_get_mime_type(is); + if (mime != NULL) { + playlist = playlist_list_open_stream_mime(is, mime); if (playlist != NULL) return playlist; } |