diff options
Diffstat (limited to 'src/DecoderAPI.cxx')
-rw-r--r-- | src/DecoderAPI.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/DecoderAPI.cxx b/src/DecoderAPI.cxx index 4c6a6f918..b31066e17 100644 --- a/src/DecoderAPI.cxx +++ b/src/DecoderAPI.cxx @@ -306,6 +306,22 @@ decoder_read(Decoder *decoder, return nbytes; } +bool +decoder_skip(Decoder *decoder, InputStream &is, size_t size) +{ + while (size > 0) { + char buffer[1024]; + size_t nbytes = decoder_read(decoder, is, buffer, + std::min(sizeof(buffer), size)); + if (nbytes == 0) + return false; + + size -= nbytes; + } + + return true; +} + void decoder_timestamp(Decoder &decoder, double t) { |