- msg_Dbg( p_input, "found theora header" );
-#ifdef HAVE_OGGPACKB
- p_stream->i_cat = VIDEO_ES;
- p_stream->i_fourcc = VLC_FOURCC( 't','h','e','o' );
-
- /* Signal that we want to keep a backup of the vorbis
- * stream headers. They will be used when switching between
- * audio streams. */
- p_stream->b_force_backup = 1;
-
- /* Cheat and get additionnal info ;) */
- oggpackB_readinit(&opb, oggpacket.packet, oggpacket.bytes);
- oggpackB_adv( &opb, 56 );
- oggpackB_read( &opb, 8 ); /* major version num */
- oggpackB_read( &opb, 8 ); /* minor version num */
- oggpackB_read( &opb, 8 ); /* subminor version num */
- oggpackB_read( &opb, 16 ) /*<< 4*/; /* width */
- oggpackB_read( &opb, 16 ) /*<< 4*/; /* height */
- oggpackB_read( &opb, 24 ); /* frame width */
- oggpackB_read( &opb, 24 ); /* frame height */
- oggpackB_read( &opb, 8 ); /* x offset */
- oggpackB_read( &opb, 8 ); /* y offset */
-
- i_fps_numerator = oggpackB_read( &opb, 32 );
- i_fps_denominator = oggpackB_read( &opb, 32 );
- oggpackB_read( &opb, 24 ); /* aspect_numerator */
- oggpackB_read( &opb, 24 ); /* aspect_denominator */
- i_keyframe_frequency_force = 1 << oggpackB_read( &opb, 5 );
- oggpackB_read( &opb, 8 ); /* colorspace */
- p_stream->i_bitrate = oggpackB_read( &opb, 24 );
- oggpackB_read( &opb, 6 ); /* quality */
-
- /* granule_shift = i_log( frequency_force -1 ) */
- p_stream->i_theora_keyframe_granule_shift = 0;
- i_keyframe_frequency_force--;
- while( i_keyframe_frequency_force )
- {
- p_stream->i_theora_keyframe_granule_shift++;
- i_keyframe_frequency_force >>= 1;
- }
-
- p_stream->f_rate = ((float)i_fps_numerator) /
- i_fps_denominator;
- msg_Dbg( p_input,
- "found theora header, bitrate: %i, rate: %f",
- p_stream->i_bitrate, p_stream->f_rate );
- {
- char title[sizeof("Stream") + 10];
- input_info_category_t *p_cat;
- sprintf( title, "Stream %d", p_ogg->i_streams );
- p_cat = input_InfoCategory( p_input, title );
- input_AddInfo( p_cat, _("Type"), _("Video") );
- input_AddInfo( p_cat, _("Codec"), _("Theora") );
- input_AddInfo( p_cat, _("Frame Rate"), "%f",
- p_stream->f_rate );
- input_AddInfo( p_cat, _("Bit Rate"), "%d",
- p_stream->i_bitrate );
- }
-#else /* HAVE_OGGPACKB */
- msg_Dbg( p_input, "the ogg demuxer has been compiled "
- "without support for the oggpackB extension."
- "The theora stream won't be decoded." );
- free( p_stream );
- p_ogg->i_streams--;
-#endif /* HAVE_OGGPACKB */
- }
- /* Check for Tarkin header */
- else if( oggpacket.bytes >= 7 &&
- ! strncmp( &oggpacket.packet[1], "tarkin", 6 ) )
- {
- oggpack_buffer opb;
-
- msg_Dbg( p_input, "found tarkin header" );
- p_stream->i_cat = VIDEO_ES;
- p_stream->i_fourcc = VLC_FOURCC( 't','a','r','k' );