-/****************************************************************************
- * Encode: the whole thing
- ****************************************************************************
- * This function spits out ogg packets.
- ****************************************************************************/
-static block_t *Headers( encoder_t *p_enc )
-{
- encoder_sys_t *p_sys = p_enc->p_sys;
- block_t *p_block, *p_chain = NULL;
-
- /* Create theora headers */
- if( !p_sys->i_headers )
- {
- ogg_packet header[3];
- int i;
-
- vorbis_analysis_headerout( &p_sys->vd, &p_sys->vc,
- &header[0], &header[1], &header[2]);
- for( i = 0; i < 3; i++ )
- {
- p_block = block_New( p_enc, header[i].bytes );
- memcpy( p_block->p_buffer, header[i].packet, header[i].bytes );
-
- p_block->i_dts = p_block->i_pts = p_block->i_length = 0;
-
- block_ChainAppend( &p_chain, p_block );
- }
- p_sys->i_headers = 3;
- }
-
- return p_chain;
-}
-