diff options
author | Max Kellermann <max@duempel.org> | 2013-12-14 12:43:06 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-12-14 12:43:06 +0100 |
commit | d37b788ea81e4b282e3f24aa5cad31d85229cc30 (patch) | |
tree | e5bfb0d14e4bdf0c50a1ec34b73b0098b18fc685 /src/decoder/MadDecoderPlugin.cxx | |
parent | cb336ff666a8fb2958cfb35c36ffcf613b02cd70 (diff) | |
download | mpd-d37b788ea81e4b282e3f24aa5cad31d85229cc30.tar.gz mpd-d37b788ea81e4b282e3f24aa5cad31d85229cc30.tar.xz mpd-d37b788ea81e4b282e3f24aa5cad31d85229cc30.zip |
DecoderAPI: add function decoder_read_full()
Move code from the "mad" plugin.
Diffstat (limited to 'src/decoder/MadDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/MadDecoderPlugin.cxx | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/decoder/MadDecoderPlugin.cxx b/src/decoder/MadDecoderPlugin.cxx index c98d65f87..1bf193993 100644 --- a/src/decoder/MadDecoderPlugin.cxx +++ b/src/decoder/MadDecoderPlugin.cxx @@ -353,18 +353,8 @@ MadDecoder::ParseId3(size_t tagsize, Tag **mpd_tag) memcpy(allocated, stream.this_frame, count); mad_stream_skip(&(stream), count); - while (count < tagsize) { - size_t len; - - len = decoder_read(decoder, input_stream, - allocated + count, tagsize - count); - if (len == 0) - break; - else - count += len; - } - - if (count != tagsize) { + if (!decoder_read_full(decoder, input_stream, + allocated + count, tagsize - count)) { LogDebug(mad_domain, "error parsing ID3 tag"); g_free(allocated); return; |