41 int i, cnum, h,
m,
s, ms, keylen = strlen(key);
44 if (keylen < 9 || sscanf(key,
"CHAPTER%02d", &cnum) != 1)
48 if (sscanf(val,
"%02d:%02d:%02d.%03d", &h, &m, &s, &ms) < 4)
52 ms + 1000*(s + 60*(m + 60*h)),
55 }
else if (!strcmp(key+9,
"NAME")) {
84 s = bytestream_get_le32(&p);
86 if (end - p - 4 < s || s < 0)
91 n = bytestream_get_le32(&p);
93 while (end - p >= 4 && n > 0) {
97 s = bytestream_get_le32(&p);
99 if (end - p < s || s < 0)
106 v = memchr(t,
'=', s);
126 for (j = 0; j < tl; j++)
133 if (!strcmp(tt,
"METADATA_BLOCK_PICTURE")) {
159 "truncated comment header, %i comments not found\n", n);
196 len = priv->
len[0] + priv->
len[1] + priv->
len[2];
197 buf_len = len + len/255 + 64;
201 memset(*buf,
'\0', buf_len);
207 for (i = 0; i < 3; i++) {
208 memcpy(&ptr[offset], priv->
packet[i], priv->
len[i]);
209 offset += priv->
len[i];
223 for (i = 0; i < 3; i++)
245 if (os->
psize < 1 || pkt_type > 5)
250 if (priv->
packet[pkt_type>>1])
252 if (pkt_type > 1 && !priv->
packet[0] || pkt_type > 3 && !priv->
packet[1])
255 priv->
len[pkt_type >> 1] = os->
psize;
257 if (!priv->
packet[pkt_type >> 1])
262 unsigned blocksize, bs0, bs1;
269 if (bytestream_get_le32(&p) != 0)
272 channels= bytestream_get_byte(&p);
278 srate = bytestream_get_le32(&p);
283 blocksize = bytestream_get_byte(&p);
284 bs0 = blocksize & 15;
285 bs1 = blocksize >> 4;
289 if (bs0 < 6 || bs1 > 13)
292 if (bytestream_get_byte(&p) != 1)
306 unsigned new_len = 7 + 4 +
AV_RL32(priv->
packet[1] + 7) + 4 + 1;
307 if (new_len >= 16 && new_len < os->psize) {
309 priv->
packet[1][new_len - 1] = 1;
310 priv->
len[1] = new_len;
352 last_pkt = next_pkt = next_pkt + os->
psize;
353 for (; seg < os->
nsegs; seg++) {
361 last_pkt = next_pkt + os->
segments[seg];
403 .
magic =
"\001vorbis",