| 286 | } |
| 287 | |
| 288 | static void |
| 289 | dsf_stream_decode(DecoderClient &client, InputStream &is) |
| 290 | { |
| 291 | /* check if it is a proper DSF file */ |
| 292 | DsfMetaData metadata; |
| 293 | if (!dsf_read_metadata(&client, is, &metadata)) |
| 294 | return; |
| 295 | |
| 296 | auto audio_format = CheckAudioFormat(metadata.sample_rate / 8, |
| 297 | SampleFormat::DSD, |
| 298 | metadata.channels); |
| 299 | |
| 300 | /* Calculate song time from DSD chunk size and sample frequency */ |
| 301 | const auto n_blocks = metadata.n_blocks; |
| 302 | auto songtime = SongTime::FromScale<uint64_t>(n_blocks * DSF_BLOCK_SIZE, |
| 303 | audio_format.sample_rate); |
| 304 | |
| 305 | /* success: file was recognized */ |
| 306 | client.Ready(audio_format, is.IsSeekable(), songtime); |
| 307 | |
| 308 | dsf_decode_chunk(client, is, metadata.channels, |
| 309 | metadata.sample_rate, |
| 310 | n_blocks, |
| 311 | metadata.bitreverse); |
| 312 | } |
| 313 | |
| 314 | static bool |
| 315 | dsf_scan_stream(InputStream &is, TagHandler &handler) |
nothing calls this directly
no test coverage detected