| 930 | } |
| 931 | |
| 932 | inline void |
| 933 | MadDecoder::RunDecoder() noexcept |
| 934 | { |
| 935 | assert(client != nullptr); |
| 936 | |
| 937 | Tag tag; |
| 938 | if (!DecodeFirstFrame(&tag)) { |
| 939 | if (client->GetCommand() == DecoderCommand::NONE) |
| 940 | LogError(mad_domain, |
| 941 | "input does not appear to be a mp3 bit stream"); |
| 942 | return; |
| 943 | } |
| 944 | |
| 945 | AllocateBuffers(); |
| 946 | |
| 947 | client->Ready(CheckAudioFormat(frame.header.samplerate, |
| 948 | SampleFormat::S24_P32, |
| 949 | MAD_NCHANNELS(&frame.header)), |
| 950 | input_stream.IsSeekable(), |
| 951 | total_time); |
| 952 | |
| 953 | if (!tag.IsEmpty()) |
| 954 | client->SubmitTag(input_stream, std::move(tag)); |
| 955 | |
| 956 | while (Read()) {} |
| 957 | } |
| 958 | |
| 959 | static void |
| 960 | mad_decode(DecoderClient &client, InputStream &input_stream) |
no test coverage detected