31 #define RETURN_ERROR(code) do { ret = (code); goto fail; } while (0)
60 avio_read(pb, mimetype,
FFMIN(len,
sizeof(mimetype) - 1)) != len) {
70 if (!strncmp(mime->
str, mimetype,
sizeof(mimetype))) {
158 int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0;
180 switch (metadata_type) {
190 if (
avio_read(s->
pb, buffer, metadata_size) != metadata_size) {
204 if (found_streaminfo) {
210 found_streaminfo = 1;
219 if (si.samplerate > 0) {
228 int i, chapters, track, ti;
229 if (metadata_size < 431)
231 offset = buffer + 395;
232 chapters = bytestream_get_byte(&offset) - 1;
235 for (i = 0; i < chapters; i++) {
236 if (offset + 36 - buffer > metadata_size)
238 start = bytestream_get_be64(&offset);
239 track = bytestream_get_byte(&offset);
243 ti = bytestream_get_byte(&offset);
258 if (!found_streaminfo) {
283 if(bufptr > end-4 || memcmp(bufptr,
"fLaC", 4))
return 0;
294 .extensions =
"flac",