Unified · Split
| @@ -88,16 +88,20 @@ Size of consumed MP3 data returned in the mp3dec_frame_info_t::frame_bytes field · 87 unmodified lines | |||
| 88 | Application must remove mp3dec_frame_info_t::frame_bytes bytes from input buffer before next decoder invocation. | 88 | Application must remove mp3dec_frame_info_t::frame_bytes bytes from input buffer before next decoder invocation. |
| 89 | 89 | ||
| 90 | Decode function returns # of decoded samples; following cases are possible: | 90 | Decode function returns # of decoded samples; following cases are possible: |
| 91 | 0 - No MP3 data was found in the input buffer | 91 | |
| 92 | - 0 - No MP3 data was found in the input buffer | ||
| 92 | 384 - Layer 1 | 93 | 384 - Layer 1 |
| 93 | 576 - MPEG 2 Layer 3 | 94 | 576 - MPEG 2 Layer 3 |
| 94 | 1152 - otherwise | 95 | 1152 - otherwise |
| 95 | 96 | ||
| 96 | Description of returned #samples and mp3dec_frame_info_t::frame_bytes combination: | 97 | Description of returned #samples and mp3dec_frame_info_t::frame_bytes combination: |
| 98 | |||
| 99 | - | ||
| 97 | #samples > 0 && frame_bytes > 0 - succesful decode | 100 | #samples > 0 && frame_bytes > 0 - succesful decode |
| 98 | #samples == 0 && frame_bytes > 0 - decoder skip ID3 or invalid data | 101 | #samples == 0 && frame_bytes > 0 - decoder skip ID3 or invalid data |
| 99 | #samples == 0 && frame_bytes == 0 - insufficied data, application must supply more data | 102 | #samples == 0 && frame_bytes == 0 - insufficied data, application must supply more data |
| 100 | #samples > 0 && frame_bytes == 0 - impossible combination | 103 | #samples > 0 && frame_bytes == 0 - impossible combination |
| 104 | |||
| 101 | Also if frame_bytes == 0 other info fields can be uninitialized/not updated, if info.frame_bytes != 0 all info fields available such as info.hz = sample rate, info.channels = mono(1)/stereo(2), info.bitrate_kbps = bitrate in kbits. | 105 | Also if frame_bytes == 0 other info fields can be uninitialized/not updated, if info.frame_bytes != 0 all info fields available such as info.hz = sample rate, info.channels = mono(1)/stereo(2), info.bitrate_kbps = bitrate in kbits. |
| 102 | 106 | ||
| 103 | Application may call mp3dec_init() when changing decode position, however, it is not necessary. | 107 | Application may call mp3dec_init() when changing decode position, however, it is not necessary. |