57 if (memcmp(&buf[1],
"vorbis", 6)) {
62 if (!(buf[29] & 0x1)) {
79 int got_framing_bit, mode_count, got_mode_header, last_mode_count = 0;
94 if (memcmp(&buf[1],
"vorbis", 6)) {
104 for (i = 0; i < buf_size; i++)
105 rev_buf[i] = buf[buf_size - 1 - i];
115 if (!got_framing_bit) {
137 if (
get_bits(&gb0, 6) + 1 == mode_count) {
139 last_mode_count = mode_count;
142 if (!got_mode_header) {
151 if (last_mode_count > 2) {
153 "%d modes (either a false positive or a "
154 "sample from an unknown encoder)",
159 if (last_mode_count > 63) {
174 for (i = mode_count - 1; i >= 0; i--) {
185 const uint8_t *extradata,
int extradata_size)
196 header_start, header_len)) < 0) {
214 int buf_size,
int *
flags)
219 int mode, current_blocksize;
230 else if (buf[0] == 3)
255 duration = (previous_blocksize + current_blocksize) >> 2;
297 #if LIBAVCODEC_VERSION_MAJOR < 57
312 int buf_size,
int *
flags)
318 #if CONFIG_VORBIS_PARSER
320 typedef struct VorbisParseContext {
322 } VorbisParseContext;
325 const uint8_t **poutbuf,
int *poutbuf_size,
344 *poutbuf_size = buf_size;
356 .priv_data_size =
sizeof(VorbisParseContext),
357 .parser_parse = vorbis_parse,
358 .parser_close = vorbis_parser_close,