From 60dbf1bea05beadb03e5a9c34c0476bd44a06724 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 13 Feb 2018 09:41:07 +0100 Subject: [PATCH] decoder/HybridDSD: calculate bit rate --- src/decoder/plugins/HybridDsdDecoderPlugin.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/decoder/plugins/HybridDsdDecoderPlugin.cxx b/src/decoder/plugins/HybridDsdDecoderPlugin.cxx index 2e2948a91..ee738fe07 100644 --- a/src/decoder/plugins/HybridDsdDecoderPlugin.cxx +++ b/src/decoder/plugins/HybridDsdDecoderPlugin.cxx @@ -179,6 +179,7 @@ HybridDsdDecode(DecoderClient &client, InputStream &input) offset_type remaining_bytes; size_t frame_size; + unsigned kbit_rate; try { auto result = FindHybridDsdData(client, input); @@ -187,6 +188,8 @@ HybridDsdDecode(DecoderClient &client, InputStream &input) /* TODO: implement seeking */ false, duration); frame_size = result.first.GetFrameSize(); + kbit_rate = frame_size * result.first.sample_rate / + (1024u / 8u); remaining_bytes = result.second; } catch (UnsupportedFile) { /* not a Hybrid-DSD file; let the next decoder plugin @@ -233,7 +236,7 @@ HybridDsdDecode(DecoderClient &client, InputStream &input) if (n_frames > 0) { cmd = client.SubmitData(input, r.data, n_frames * frame_size, - 0); + kbit_rate); buffer.Consume(n_frames * frame_size); } }