diff options
author | Max Kellermann <max@duempel.org> | 2014-08-19 20:58:08 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-08-19 20:58:08 +0200 |
commit | 9be90bd1c93f2d78be687dbe9b5a98a28b2b767e (patch) | |
tree | 6edc8c5cc6b7e2e79ded7bcd1b957314c0df78e3 /src/decoder/plugins/WavpackDecoderPlugin.cxx | |
parent | 106e5355774a108b0479cca140e877d3da9a9fde (diff) | |
download | mpd-9be90bd1c93f2d78be687dbe9b5a98a28b2b767e.tar.gz mpd-9be90bd1c93f2d78be687dbe9b5a98a28b2b767e.tar.xz mpd-9be90bd1c93f2d78be687dbe9b5a98a28b2b767e.zip |
decoder/wavpack: add local reference variables
Diffstat (limited to 'src/decoder/plugins/WavpackDecoderPlugin.cxx')
-rw-r--r-- | src/decoder/plugins/WavpackDecoderPlugin.cxx | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/src/decoder/plugins/WavpackDecoderPlugin.cxx b/src/decoder/plugins/WavpackDecoderPlugin.cxx index 2f60090c1..88fa2af56 100644 --- a/src/decoder/plugins/WavpackDecoderPlugin.cxx +++ b/src/decoder/plugins/WavpackDecoderPlugin.cxx @@ -386,19 +386,24 @@ WavpackInput::ReadBytes(void *data, size_t bcount) static uint32_t wavpack_input_get_pos(void *id) { - return wpin(id)->is.GetOffset(); + WavpackInput &wpi = *wpin(id); + + return wpi.is.GetOffset(); } static int wavpack_input_set_pos_abs(void *id, uint32_t pos) { - return wpin(id)->is.LockSeek(pos, IgnoreError()) ? 0 : -1; + WavpackInput &wpi = *wpin(id); + + return wpi.is.LockSeek(pos, IgnoreError()) ? 0 : -1; } static int wavpack_input_set_pos_rel(void *id, int32_t delta, int mode) { - InputStream &is = wpin(id)->is; + WavpackInput &wpi = *wpin(id); + InputStream &is = wpi.is; InputStream::offset_type offset = delta; switch (mode) { @@ -426,8 +431,10 @@ wavpack_input_set_pos_rel(void *id, int32_t delta, int mode) static int wavpack_input_push_back_byte(void *id, int c) { - if (wpin(id)->last_byte == EOF) { - wpin(id)->last_byte = c; + WavpackInput &wpi = *wpin(id); + + if (wpi.last_byte == EOF) { + wpi.last_byte = c; return c; } else { return EOF; @@ -437,16 +444,22 @@ wavpack_input_push_back_byte(void *id, int c) static uint32_t wavpack_input_get_length(void *id) { - if (!wpin(id)->is.KnownSize()) + WavpackInput &wpi = *wpin(id); + InputStream &is = wpi.is; + + if (!is.KnownSize()) return 0; - return wpin(id)->is.GetSize(); + return is.GetSize(); } static int wavpack_input_can_seek(void *id) { - return wpin(id)->is.IsSeekable(); + WavpackInput &wpi = *wpin(id); + InputStream &is = wpi.is; + + return is.IsSeekable(); } static WavpackStreamReader mpd_is_reader = { |