As each packet is enqueued, its validity is checked against the framing constraints outlined in the Ogg basics section. If it does not pass these constraints, oggz_write_feed() will fail with an appropriate error code.

Note

When writing, you can ensure that a packet starts on a new page by setting the flush parameter of oggz_write_feed() to OGGZ_FLUSH_BEFORE when enqueuing it. Similarly you can ensure that the last page a packet is written into won't contain any following packets by setting the flush parameter of oggz_write_feed() to OGGZ_FLUSH_AFTER.

The OGGZ_FLUSH_BEFORE and OGGZ_FLUSH_AFTER flags can be bitwise OR'd together to ensure that the packet will not share any pages with any other packets, either before or after.

Packet would be bos packet of a new logical bitstream, but oggz has already written one or more non-bos packets in other logical bitstreams, and oggz is not flagged OGGZ_NONSTRICT

OGGZ_ERR_EOS

The logical bitstream identified by serialno is already at eos, and oggz is not flagged OGGZ_NONSTRICT

OGGZ_ERR_BAD_BYTES

op->bytes is invalid, and oggz is not flagged OGGZ_NONSTRICT

OGGZ_ERR_BAD_B_O_S

op->b_o_s is invalid, and oggz is not flagged OGGZ_NONSTRICT

OGGZ_ERR_BAD_GRANULEPOS

op->granulepos is less than that of an earlier packet within this logical bitstream, and oggz is not flagged OGGZ_NONSTRICT

OGGZ_ERR_BAD_PACKETNO

op->packetno is less than that of an earlier packet within this logical bitstream, and oggz is not flagged OGGZ_NONSTRICT

OGGZ_ERR_BAD_SERIALNO

serialno does not identify an existing logical bitstream in oggz, and oggz is not flagged OGGZ_NONSTRICT or serialno is equal to -1, or serialno does not fit in 32 bits, ie. within the range (-(2^31), (2^31)-1)

OGGZ_ERR_BAD_OGGZ

oggz does not refer to an existing OGGZ

OGGZ_ERR_INVALID

Operation not suitable for this OGGZ

OGGZ_ERR_OUT_OF_MEMORY

Unable to allocate memory to queue packet

Note

If op->b_o_s is initialized to -1 before calling oggz_write_feed(), Oggz will fill it in with the appropriate value; ie. 1 for the first packet of a new stream, and 0 otherwise.