aboutsummaryrefslogtreecommitdiffstats
path: root/src/decoder
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-06 21:46:10 +0100
committerMax Kellermann <max@duempel.org>2014-07-12 00:15:35 +0200
commit9d9697b36626b2a74d9b535b284b6e3dacd2b414 (patch)
tree5e16e453ce9af6cf93818ac42b5ed10300d93a76 /src/decoder
parent6585e18571df900c4ffe862ec02cd7376af7bbbd (diff)
downloadmpd-9d9697b36626b2a74d9b535b284b6e3dacd2b414.tar.gz
mpd-9d9697b36626b2a74d9b535b284b6e3dacd2b414.tar.xz
mpd-9d9697b36626b2a74d9b535b284b6e3dacd2b414.zip
DecoderBuffer: add method _clear()
Diffstat (limited to 'src/decoder')
-rw-r--r--src/decoder/FaadDecoderPlugin.cxx11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/decoder/FaadDecoderPlugin.cxx b/src/decoder/FaadDecoderPlugin.cxx
index 7279d7107..9c8bdb6ef 100644
--- a/src/decoder/FaadDecoderPlugin.cxx
+++ b/src/decoder/FaadDecoderPlugin.cxx
@@ -81,7 +81,7 @@ adts_find_frame(DecoderBuffer *buffer)
const uint8_t *p = (const uint8_t *)memchr(data, 0xff, length);
if (p == nullptr) {
/* no marker - discard the buffer */
- decoder_buffer_consume(buffer, length);
+ decoder_buffer_clear(buffer);
continue;
}
@@ -108,10 +108,7 @@ adts_find_frame(DecoderBuffer *buffer)
/* not enough data; discard this frame
to prevent a possible buffer
overflow */
- data = (const uint8_t *)
- decoder_buffer_read(buffer, &length);
- if (data != nullptr)
- decoder_buffer_consume(buffer, length);
+ decoder_buffer_clear(buffer);
}
continue;
@@ -196,9 +193,7 @@ faad_song_duration(DecoderBuffer *buffer, InputStream &is)
is.LockSeek(tagsize, SEEK_SET, IgnoreError());
- data = (const uint8_t *)decoder_buffer_read(buffer, &length);
- if (data != nullptr)
- decoder_buffer_consume(buffer, length);
+ decoder_buffer_clear(buffer);
decoder_buffer_fill(buffer);
return song_length;