input/InputStream: migrate from class Error to C++ exceptions

This commit is contained in:
Max Kellermann
2016-09-09 18:47:42 +02:00
parent 597e59f10d
commit 8c744efd56
64 changed files with 440 additions and 473 deletions

View File

@@ -126,11 +126,13 @@ VorbisDecoder::Seek(uint64_t where_frame)
const ogg_int64_t where_granulepos(where_frame);
if (!SeekGranulePos(where_granulepos, IgnoreError()))
try {
SeekGranulePos(where_granulepos);
vorbis_synthesis_restart(&dsp);
return true;
} catch (const std::runtime_error &) {
return false;
vorbis_synthesis_restart(&dsp);
return true;
}
}
void
@@ -311,7 +313,10 @@ vorbis_stream_decode(Decoder &decoder,
/* rewind the stream, because ogg_codec_detect() has
moved it */
input_stream.LockRewind(IgnoreError());
try {
input_stream.LockRewind();
} catch (const std::runtime_error &) {
}
DecoderReader reader(decoder, input_stream);
VorbisDecoder d(reader);