diff options
Diffstat (limited to 'src/codecs/vorbis.cpp')
| -rw-r--r-- | src/codecs/vorbis.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/codecs/vorbis.cpp b/src/codecs/vorbis.cpp index ea33a2af..464aa4a2 100644 --- a/src/codecs/vorbis.cpp +++ b/src/codecs/vorbis.cpp @@ -118,6 +118,12 @@ auto TremorVorbisDecoder::OpenStream(std::shared_ptr<IStream> input, length = l * info->channels; } + auto b = ov_bitrate(vorbis_.get(), -1); + std::optional<uint32_t> bitrate_kbps; + if (b > 0) { + bitrate_kbps = b / 1024; + } + if (offset && ov_time_seek(vorbis_.get(), offset * 1000) != 0) { return cpp::fail(Error::kInternalError); } @@ -126,6 +132,7 @@ auto TremorVorbisDecoder::OpenStream(std::shared_ptr<IStream> input, .num_channels = static_cast<uint8_t>(info->channels), .sample_rate_hz = static_cast<uint32_t>(info->rate), .total_samples = length, + .bitrate_kbps = bitrate_kbps, }; } |
