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 | 88 | Application must remove mp3dec_frame_info_t::frame_bytes bytes from input buffer before next decoder invocation. |
| 89 | 89 | |
| 90 | 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 | 93 | 384 - Layer 1 |
| 93 | 94 | 576 - MPEG 2 Layer 3 |
| 94 | 95 | 1152 - otherwise |
| 95 | 96 | |
| 96 | 97 | Description of returned #samples and mp3dec_frame_info_t::frame_bytes combination: |
| 98 | + | |
| 99 | +- | |
| 97 | 100 | #samples > 0 && frame_bytes > 0 - succesful decode |
| 98 | 101 | #samples == 0 && frame_bytes > 0 - decoder skip ID3 or invalid data |
| 99 | 102 | #samples == 0 && frame_bytes == 0 - insufficied data, application must supply more data |
| 100 | 103 | #samples > 0 && frame_bytes == 0 - impossible combination |
| 104 | + | |
| 101 | 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 | 107 | Application may call mp3dec_init() when changing decode position, however, it is not necessary. |