ref: 6908db1cfd68d58c17bba033d91ad3affa95ba05
parent: 559ba99b47309a860f3bb2510ce330f83018bb5a
author: Jean-Marc Valin <jmvalin@jmvalin.ca>
date: Fri May 5 11:15:23 EDT 2017
Fix bos and eos (I think)
--- a/src/ogg_packer.c
+++ b/src/ogg_packer.c
@@ -350,12 +350,14 @@
cont = 1;
} else {
p->buf_size = oggp->buf_fill - oggp->buf_begin;
+ if (oggp->is_eos) p->flags |= 0x04;
}
nb_lacing -= p->lacing_size;
oggp->lacing_begin += p->lacing_size;
oggp->buf_begin += p->buf_size;
p->pageno = oggp->pageno++;
- /* FIXME: Handle bos/eos and continued pages. */
+ if (p->pageno == 0)
+ p->flags |= 0x02;
} while (nb_lacing>0);
oggp->last_granule = oggp->curr_granule;
@@ -386,10 +388,7 @@
/* stream structure version */
ptr[4]=0x00;
- /* FIXME: handle eos/continuation */
ptr[5]=0x00 | p->flags;
- if (p->pageno == 0) ptr[5] |= 0x02;
- if (oggp->pages_fill==1 && oggp->is_eos) ptr[5] |= 0x04;
granule_pos = p->granulepos;
/* 64 bits of PCM position */