diff options
author | Max Kellermann <max@duempel.org> | 2010-01-18 10:21:57 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-01-18 10:21:57 +0100 |
commit | ca1fc13116cbac10711455b4e57e242b967c6f6e (patch) | |
tree | 35b734bbb1ada8fc04f8c1562d08ecc68636308d /src/decoder | |
parent | 9cb7760c5eb63cb6b7034ec9d2cdf9af2f198652 (diff) | |
download | mpd-ca1fc13116cbac10711455b4e57e242b967c6f6e.tar.gz mpd-ca1fc13116cbac10711455b4e57e242b967c6f6e.tar.xz mpd-ca1fc13116cbac10711455b4e57e242b967c6f6e.zip |
decoder_api: removed function decoder_get_uri()
Use input_stream.uri.
Diffstat (limited to 'src/decoder')
-rw-r--r-- | src/decoder/ffmpeg_decoder_plugin.c | 11 | ||||
-rw-r--r-- | src/decoder/vorbis_decoder_plugin.c | 17 | ||||
-rw-r--r-- | src/decoder/wavpack_decoder_plugin.c | 9 |
3 files changed, 11 insertions, 26 deletions
diff --git a/src/decoder/ffmpeg_decoder_plugin.c b/src/decoder/ffmpeg_decoder_plugin.c index 41c4648b8..1ecc9e013 100644 --- a/src/decoder/ffmpeg_decoder_plugin.c +++ b/src/decoder/ffmpeg_decoder_plugin.c @@ -162,7 +162,7 @@ append_uri_suffix(struct ffmpeg_stream *stream, const char *uri) } static bool -ffmpeg_helper(const char *uri, struct input_stream *input, +ffmpeg_helper(struct input_stream *input, bool (*callback)(struct ffmpeg_context *ctx), struct ffmpeg_context *ctx) { @@ -175,8 +175,8 @@ ffmpeg_helper(const char *uri, struct input_stream *input, }; bool ret; - if (uri != NULL) - append_uri_suffix(&stream, uri); + if (input->uri != NULL) + append_uri_suffix(&stream, input->uri); stream.input = input; if (ctx && ctx->decoder) { @@ -385,8 +385,7 @@ ffmpeg_decode(struct decoder *decoder, struct input_stream *input) ctx.input = input; ctx.decoder = decoder; - ffmpeg_helper(decoder_get_uri(decoder), input, - ffmpeg_decode_internal, &ctx); + ffmpeg_helper(input, ffmpeg_decode_internal, &ctx); } #if LIBAVFORMAT_VERSION_INT >= ((52<<16)+(31<<8)+0) @@ -459,7 +458,7 @@ ffmpeg_stream_tag(struct input_stream *is) ctx.decoder = NULL; ctx.tag = tag_new(); - ret = ffmpeg_helper(NULL, is, ffmpeg_tag_internal, &ctx); + ret = ffmpeg_helper(is, ffmpeg_tag_internal, &ctx); if (!ret) { tag_free(ctx.tag); ctx.tag = NULL; diff --git a/src/decoder/vorbis_decoder_plugin.c b/src/decoder/vorbis_decoder_plugin.c index 12a6623b2..0163ca9ff 100644 --- a/src/decoder/vorbis_decoder_plugin.c +++ b/src/decoder/vorbis_decoder_plugin.c @@ -245,19 +245,10 @@ vorbis_send_comments(struct decoder *decoder, struct input_stream *is, } static bool -oggvorbis_seekable(struct decoder *decoder) +oggvorbis_seekable(const struct input_stream *is) { - char *uri; - bool seekable; - - uri = decoder_get_uri(decoder); - /* disable seeking on remote streams, because libvorbis seeks - around like crazy, and due to being very expensive, this - delays song playback by 10 or 20 seconds */ - seekable = !uri_has_scheme(uri); - g_free(uri); - - return seekable; + return is->seekable && + (is->uri == NULL || !uri_has_scheme(is->uri)); } /* public */ @@ -289,7 +280,7 @@ vorbis_stream_decode(struct decoder *decoder, data.decoder = decoder; data.input_stream = input_stream; - data.seekable = input_stream->seekable && oggvorbis_seekable(decoder); + data.seekable = oggvorbis_seekable(input_stream); callbacks.read_func = ogg_read_cb; callbacks.seek_func = ogg_seek_cb; diff --git a/src/decoder/wavpack_decoder_plugin.c b/src/decoder/wavpack_decoder_plugin.c index 380985f85..a037688fc 100644 --- a/src/decoder/wavpack_decoder_plugin.c +++ b/src/decoder/wavpack_decoder_plugin.c @@ -466,7 +466,6 @@ static struct input_stream * wavpack_open_wvc(struct decoder *decoder, struct wavpack_input *wpi) { struct input_stream *is_wvc; - char *utf8url; char *wvc_url = NULL; char first_byte; size_t nbytes; @@ -475,14 +474,10 @@ wavpack_open_wvc(struct decoder *decoder, struct wavpack_input *wpi) * As we use dc->utf8url, this function will be bad for * single files. utf8url is not absolute file path :/ */ - utf8url = decoder_get_uri(decoder); - if (utf8url == NULL) { + if (wpi->is->uri == NULL) return false; - } - - wvc_url = g_strconcat(utf8url, "c", NULL); - g_free(utf8url); + wvc_url = g_strconcat(wpi->is->uri, "c", NULL); is_wvc = input_stream_open(wvc_url, NULL); g_free(wvc_url); |