| 73 | } |
| 74 | |
| 75 | void FileSourceAnnexBFile::seekToFirstNAL() |
| 76 | { |
| 77 | auto nextStartCodePos = this->fileBuffer.indexOf(STARTCODE); |
| 78 | if (nextStartCodePos < 0) |
| 79 | // The first buffer does not contain a start code. This is very unusual. Use the normal getNextNALUnit to seek |
| 80 | this->getNextNALUnit(); |
| 81 | else |
| 82 | { |
| 83 | // For 0001 or 001 point to the first 0 byte |
| 84 | if (nextStartCodePos > 0 && this->fileBuffer.at(nextStartCodePos-1) ==(char)0) |
| 85 | this->posInBuffer = nextStartCodePos - 1; |
| 86 | else |
| 87 | this->posInBuffer = nextStartCodePos; |
| 88 | } |
| 89 | |
| 90 | assert(this->posInBuffer >= 0); |
| 91 | this->nrBytesBeforeFirstNAL = this->bufferStartPosInFile + uint64_t(this->posInBuffer); |
| 92 | } |
| 93 | |
| 94 | QByteArray FileSourceAnnexBFile::getNextNALUnit(bool getLastDataAgain, pairUint64 *startEndPosInFile) |
| 95 | { |
no test coverage detected