Lines Matching defs:offset
30 * Note that if the returned value + offset > size, it means that a partial frame starts at that
31 * offset, but this function will still return the size of the full frame.
33 * @param offset offset in bytes relative to data of where the frame is supposed to start
35 * @return the size in bytes of the AAC ADTS frame starting at the given offset of the given
38 static size_t getAdtsFrameSize(const uint8_t *data, off64_t offset, size_t size) {
41 if (!(offset + ADTS_HEADER_SIZE_UP_TO_FRAMESIZE < size)) {
47 const uint8_t *syncword = data + offset;
53 const uint8_t protectionAbsent = data[offset+1] & 0x1;
55 const uint8_t* header = data + offset + 3;
85 off64_t offset = 0;
93 while (offset < size) {
94 if ((frameSize = getAdtsFrameSize((uint8_t *)data, offset, size)) == 0) {
95 SL_LOGE("found ADTS frame of size 0 at offset %llu", offset);
98 //SL_LOGV("last good offset %llu", offset);
99 offset += frameSize;
100 if (offset > size) {
105 if (offset != size) { SL_LOGE("ADTS parsing error: reached end of incomplete frame"); }
106 assert(offset == size);