39 int i, cnum, h,
m, s, ms, keylen = strlen(key);
42 if (keylen < 9 || sscanf(key,
"CHAPTER%02d", &cnum) != 1)
46 if (sscanf(val,
"%02d:%02d:%02d.%03d", &h, &m, &s, &ms) < 4)
50 ms + 1000*(s + 60*(m + 60*h)),
53 }
else if (!strcmp(key+9,
"NAME")) {
82 s = bytestream_get_le32(&p);
84 if (end - p - 4 < s || s < 0)
89 n = bytestream_get_le32(&p);
91 while (end - p >= 4 && n > 0) {
95 s = bytestream_get_le32(&p);
97 if (end - p < s || s < 0)
104 v = memchr(t,
'=', s);
124 for (j = 0; j < tl; j++)
125 tt[j] = toupper(t[j]);
142 "truncated comment header, %i comments not found\n", n);
179 len = priv->
len[0] + priv->
len[1] + priv->
len[2];
186 for (i = 0; i < 3; i++) {
187 memcpy(&ptr[offset], priv->
packet[i], priv->
len[i]);
188 offset += priv->
len[i];
202 for (i = 0; i < 3; i++)
224 if (os->
psize < 1 || pkt_type > 5)
229 if (priv->
packet[pkt_type>>1])
231 if (pkt_type > 1 && !priv->
packet[0] || pkt_type > 3 && !priv->
packet[1])
234 priv->
len[pkt_type >> 1] = os->
psize;
236 if (!priv->
packet[pkt_type >> 1])
241 unsigned blocksize, bs0, bs1;
248 if (bytestream_get_le32(&p) != 0)
251 channels= bytestream_get_byte(&p);
257 srate = bytestream_get_le32(&p);
262 blocksize = bytestream_get_byte(&p);
263 bs0 = blocksize & 15;
264 bs1 = blocksize >> 4;
268 if (bs0 < 6 || bs1 > 13)
271 if (bytestream_get_byte(&p) != 1)
285 unsigned new_len = 7 + 4 +
AV_RL32(priv->
packet[1] + 7) + 4 + 1;
286 if (new_len >= 16 && new_len < os->psize) {
288 priv->
packet[1][new_len - 1] = 1;
289 priv->
len[1] = new_len;
331 last_pkt = next_pkt = next_pkt + os->
psize;
332 for (; seg < os->
nsegs; seg++) {
340 last_pkt = next_pkt + os->
segments[seg];
382 .
magic =
"\001vorbis",