From e7e6c70fb31d33ae1e79f9841f5b6fe227f6ebf3 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 29 Feb 2024 12:18:17 +1100 Subject: Remove unused 'SeekTo' method on codecs --- src/codecs/vorbis.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/codecs/vorbis.cpp') diff --git a/src/codecs/vorbis.cpp b/src/codecs/vorbis.cpp index ada92fb6..9131451b 100644 --- a/src/codecs/vorbis.cpp +++ b/src/codecs/vorbis.cpp @@ -77,7 +77,8 @@ TremorVorbisDecoder::~TremorVorbisDecoder() { ov_clear(vorbis_.get()); } -auto TremorVorbisDecoder::OpenStream(std::shared_ptr input,uint32_t offset) +auto TremorVorbisDecoder::OpenStream(std::shared_ptr input, + uint32_t offset) -> cpp::result { int res = ov_open_callbacks(input.get(), vorbis_.get(), NULL, 0, kCallbacks); if (res < 0) { @@ -117,8 +118,8 @@ auto TremorVorbisDecoder::OpenStream(std::shared_ptr input,uint32_t off length = l * info->channels; } - if (offset) { - ov_time_seek(vorbis_.get(), offset*1000); + if (offset && ov_time_seek(vorbis_.get(), offset * 1000) != 0) { + return cpp::fail(Error::kInternalError); } return OutputFormat{ @@ -149,11 +150,4 @@ auto TremorVorbisDecoder::DecodeTo(cpp::span output) }; } -auto TremorVorbisDecoder::SeekTo(size_t target) -> cpp::result { - if (ov_pcm_seek(vorbis_.get(), target) != 0) { - return cpp::fail(Error::kInternalError); - } - return {}; -} - } // namespace codecs -- cgit v1.2.3