38 #define MAX_PAGE_SIZE 65307
39 #define DECODER_BUFFER_SIZE MAX_PAGE_SIZE
75 for (i = 0; i < ogg->
nstreams; i++) {
131 for (i = 0; i < ogg->
nstreams; i++) {
145 if (start_pos <= s->data_offset) {
160 for (i = 0; ogg_codecs[i]; i++)
163 return ogg_codecs[i];
191 for (i = 0; i < ogg->
nstreams; i++) {
217 memset(os, 0,
sizeof(*os));
238 "in between Ogg context save/restore operations.\n");
248 memset(os, 0,
sizeof(*os));
318 if (sync[sp & 3] ==
'O' &&
319 sync[(sp + 1) & 3] ==
'g' &&
320 sync[(sp + 2) & 3] ==
'g' && sync[(sp + 3) & 3] ==
'S')
381 for (i = 0; i <
nsegs; i++)
460 av_dlog(s,
"ogg_packet: idx=%d pstart=%d psize=%d segp=%d nsegs=%d\n",
488 if (!complete && os->
segp == os->
nsegs) {
501 "Page at %"PRId64
" is missing granule\n",
523 for (i = 0; i < ogg->
nstreams; i++) {
615 while (streams_left > 0 && !
ogg_packet(s, &i, NULL, NULL, NULL)) {
638 for (i = 0; i < ogg->
nstreams; i++) {
667 for (i = 0; i < ogg->
nstreams; i++) {
675 "Headers mismatch for stream %d: "
676 "expected %d received %d.\n",
741 int64_t fpos, pts, dts;
751 ret =
ogg_packet(s, &idx, &pstart, &psize, &fpos);
754 }
while (idx < 0 || !s->streams[idx]);
772 memcpy(pkt->
data, os->
buf + pstart, psize);
784 int64_t *pos_arg, int64_t pos_limit)
796 && !
ogg_packet(s, &i, &pstart, &psize, pos_arg)) {
797 if (i == stream_index) {
820 int64_t timestamp,
int flags)
838 os = ogg->
streams + stream_index;
846 if (!memcmp(
"OggS", p->
buf, 5) && p->
buf[5] <= 0x7)
854 .priv_data_size =
sizeof(
struct ogg),