FastLED 3.9.15
Loading...
Searching...
No Matches

◆ start_page_no_capturepattern()

static int32_t fl::third_party::vorbis::start_page_no_capturepattern ( vorb * f)
static

Definition at line 1172 of file stb_vorbis.cpp.hpp.

1173{
1174 uint32 loc0,loc1,n;
1175 if (f->first_decode && !FL_STBV_IS_PUSH_MODE(f)) {
1177 }
1178 // stream structure version
1179 if (0 != get8(f)) return error(f, VORBIS_invalid_stream_structure_version);
1180 // header flag
1181 f->page_flag = get8(f);
1182 // absolute granule position
1183 loc0 = get32(f);
1184 loc1 = get32(f);
1185 // @TODO: validate loc0,loc1 as valid positions?
1186 // stream serial number -- vorbis doesn't interleave, so discard
1187 get32(f);
1188 //if (f->serial != get32(f)) return error(f, VORBIS_incorrect_stream_serial_number);
1189 // page sequence number
1190 n = get32(f);
1191 f->last_page = n;
1192 // CRC32
1193 get32(f);
1194 // page_segments
1195 f->segment_count = get8(f);
1196 if (!getn(f, f->segments, f->segment_count))
1197 return error(f, VORBIS_unexpected_eof);
1198 // assume we _don't_ know any the sample position of any segments
1199 f->end_seg_with_known_loc = -2;
1200 if (loc0 != ~0U || loc1 != ~0U) {
1201 int32_t i;
1202 // determine which packet is the last one that will complete
1203 for (i=f->segment_count-1; i >= 0; --i)
1204 if (f->segments[i] < 255)
1205 break;
1206 // 'i' is now the index of the _last_ segment of a packet that ends
1207 if (i >= 0) {
1209 f->known_loc_for_packet = loc0;
1210 }
1211 }
1212 if (f->first_decode) {
1213 int32_t i,len;
1214 len = 0;
1215 for (i=0; i < f->segment_count; ++i)
1216 len += f->segments[i];
1217 len += 27 + f->segment_count;
1218 f->p_first.page_end = f->p_first.page_start + len;
1219 f->p_first.last_decoded_sample = loc0;
1220 }
1221 f->next_seg = 0;
1222 return true;
1223}
static int32_t error(vorb *f, enum STBVorbisError e) FL_NOEXCEPT
static int32_t getn(vorb *z, uint8 *data, int32_t n) FL_NOEXCEPT
static uint8 get8(vorb *z) FL_NOEXCEPT
uint32_t stb_vorbis_get_file_offset(stb_vorbis *f) FL_NOEXCEPT
static uint32 get32(vorb *f) FL_NOEXCEPT
fl::i32 int32_t
Definition coder.h:220
#define FL_STBV_IS_PUSH_MODE(f)

References error(), FL_NOEXCEPT, FL_STBV_IS_PUSH_MODE, get32(), get8(), getn(), stb_vorbis_get_file_offset(), VORBIS_invalid_stream_structure_version, and VORBIS_unexpected_eof.

Referenced by maybe_start_packet(), and start_page().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: