+ case VIDEO_ES:
+ if( !p_input->p_fmt->video.i_frame_rate ||
+ !p_input->p_fmt->video.i_frame_rate_base )
+ {
+ msg_Warn( p_mux, "Missing frame rate, assuming 25fps" );
+ p_input->p_fmt->video.i_frame_rate = 25;
+ p_input->p_fmt->video.i_frame_rate_base = 1;
+ }
+
+ switch( p_stream->i_fourcc )
+ {
+ case VLC_CODEC_MP4V:
+ case VLC_CODEC_MPGV:
+ case VLC_CODEC_DIV3:
+ case VLC_CODEC_MJPG:
+ case VLC_CODEC_WMV1:
+ case VLC_CODEC_WMV2:
+ case VLC_CODEC_WMV3:
+ case VLC_CODEC_SNOW:
+ p_stream->p_oggds_header = calloc( 1, sizeof(oggds_header_t) );
+ if( !p_stream->p_oggds_header )
+ {
+ free( p_stream );
+ return VLC_ENOMEM;
+ }
+ p_stream->p_oggds_header->i_packet_type = PACKET_TYPE_HEADER;
+
+ memcpy( p_stream->p_oggds_header->stream_type, "video", 5 );
+ if( p_stream->i_fourcc == VLC_CODEC_MP4V )
+ {
+ memcpy( p_stream->p_oggds_header->sub_type, "XVID", 4 );
+ }
+ else if( p_stream->i_fourcc == VLC_CODEC_DIV3 )
+ {
+ memcpy( p_stream->p_oggds_header->sub_type, "DIV3", 4 );
+ }
+ else
+ {
+ memcpy( p_stream->p_oggds_header->sub_type,
+ &p_stream->i_fourcc, 4 );
+ }
+ SetDWLE( &p_stream->p_oggds_header->i_size,
+ sizeof( oggds_header_t ) - 1 );
+ SetQWLE( &p_stream->p_oggds_header->i_time_unit,
+ INT64_C(10000000) * p_input->p_fmt->video.i_frame_rate_base /
+ (int64_t)p_input->p_fmt->video.i_frame_rate );
+ SetQWLE( &p_stream->p_oggds_header->i_samples_per_unit, 1 );
+ SetDWLE( &p_stream->p_oggds_header->i_default_len, 1 ); /* ??? */
+ SetDWLE( &p_stream->p_oggds_header->i_buffer_size, 1024*1024 );
+ SetWLE( &p_stream->p_oggds_header->i_bits_per_sample, 0 );
+ SetDWLE( &p_stream->p_oggds_header->header.video.i_width,
+ p_input->p_fmt->video.i_width );
+ SetDWLE( &p_stream->p_oggds_header->header.video.i_height,
+ p_input->p_fmt->video.i_height );
+ msg_Dbg( p_mux, "%4.4s stream", (char *)&p_stream->i_fourcc );
+ break;
+
+ case VLC_CODEC_DIRAC:
+ msg_Dbg( p_mux, "dirac stream" );
+ break;
+
+ case VLC_CODEC_THEORA:
+ msg_Dbg( p_mux, "theora stream" );
+ break;
+
+ default:
+ FREENULL( p_input->p_sys );
+ return VLC_EGENERIC;
+ }
+ break;
+
+ case AUDIO_ES:
+ switch( p_stream->i_fourcc )
+ {
+ case VLC_CODEC_VORBIS:
+ msg_Dbg( p_mux, "vorbis stream" );
+ break;
+
+ case VLC_CODEC_SPEEX:
+ msg_Dbg( p_mux, "speex stream" );
+ break;
+
+ case VLC_CODEC_FLAC:
+ msg_Dbg( p_mux, "flac stream" );
+ break;
+
+ default:
+ fourcc_to_wf_tag( p_stream->i_fourcc, &i_tag );
+ if( i_tag == WAVE_FORMAT_UNKNOWN )