-
- /* create one program */
- vlc_mutex_lock( &p_input->stream.stream_lock );
- if( input_InitStream( p_input, 0 ) == -1)
- {
- vlc_mutex_unlock( &p_input->stream.stream_lock );
- msg_Err( p_input, "cannot init stream" );
- goto error;
- }
- if( input_AddProgram( p_input, 0, 0) == NULL )
- {
- vlc_mutex_unlock( &p_input->stream.stream_lock );
- msg_Err( p_input, "cannot add program" );
- goto error;
- }
-
- p_input->stream.p_selected_program = p_input->stream.pp_programs[0];
- p_input->stream.i_mux_rate = p_sys->wf.nAvgBytesPerSec / 50;
-
- p_sys->p_es = input_AddES( p_input, p_input->stream.p_selected_program,
- 0x01, AUDIO_ES, NULL, 0 );
-
- p_sys->p_es->i_stream_id = 0x01;
- p_sys->p_es->i_fourcc = i_fourcc;
- p_sys->p_es->p_waveformatex= malloc( sizeof( WAVEFORMATEX ) );
- memcpy( p_sys->p_es->p_waveformatex, &p_sys->wf, sizeof( WAVEFORMATEX ) );
-
- input_SelectES( p_input, p_sys->p_es );
-
- p_input->stream.p_selected_program->b_is_ok = 1;
- vlc_mutex_unlock( &p_input->stream.stream_lock );