input_Control( p_input, INPUT_GET_STATE, &state );
return state;
}
-VLC_EXPORT( decoder_t *, input_DecoderNew, ( input_thread_t *, es_format_t *, bool b_force_decoder ) );
+VLC_EXPORT( decoder_t *, input_DecoderNew, ( input_thread_t *, es_format_t *, sout_instance_t * ) );
VLC_EXPORT( void, input_DecoderDelete, ( decoder_t * ) );
VLC_EXPORT( void, input_DecoderDecode,( decoder_t *, block_t * ) );
#include "stream_output/stream_output.h"
#include "input_internal.h"
-static decoder_t * CreateDecoder( input_thread_t *, es_format_t *, int );
+static decoder_t * CreateDecoder( input_thread_t *, es_format_t *, int, sout_instance_t *p_sout );
static void DeleteDecoder( decoder_t * );
static void* DecoderThread( vlc_object_t * );
* \return the spawned decoder object
*/
decoder_t *input_DecoderNew( input_thread_t *p_input,
- es_format_t *fmt, bool b_force_decoder )
+ es_format_t *fmt, sout_instance_t *p_sout )
{
decoder_t *p_dec = NULL;
vlc_value_t val;
(void)b_force_decoder;
#else
/* If we are in sout mode, search for packetizer module */
- if( p_input->p->p_sout && !b_force_decoder )
+ if( p_sout )
{
/* Create the decoder configuration structure */
- p_dec = CreateDecoder( p_input, fmt, VLC_OBJECT_PACKETIZER );
+ p_dec = CreateDecoder( p_input, fmt, VLC_OBJECT_PACKETIZER, p_sout );
if( p_dec == NULL )
{
msg_Err( p_input, "could not create packetizer" );
#endif
{
/* Create the decoder configuration structure */
- p_dec = CreateDecoder( p_input, fmt, VLC_OBJECT_DECODER );
+ p_dec = CreateDecoder( p_input, fmt, VLC_OBJECT_DECODER, p_sout );
if( p_dec == NULL )
{
msg_Err( p_input, "could not create decoder" );
return NULL;
}
- if( p_input->p->p_sout && p_input->p->input.b_can_pace_control &&
- !b_force_decoder )
+ if( p_sout && p_sout == p_input->p->p_sout && p_input->p->input.b_can_pace_control )
{
msg_Dbg( p_input, "stream out mode -> no decoder thread" );
p_dec->p_owner->b_own_thread = false;
es_format_t fmt;
es_format_Init( &fmt, SPU_ES, fcc[i_channel] );
- p_cc = CreateDecoder( p_owner->p_input, &fmt, VLC_OBJECT_DECODER );
+ p_cc = CreateDecoder( p_owner->p_input, &fmt, VLC_OBJECT_DECODER, p_dec->p_owner->p_sout );
if( !p_cc )
{
msg_Err( p_dec, "could not create decoder" );
* \return the decoder object
*/
static decoder_t * CreateDecoder( input_thread_t *p_input,
- es_format_t *fmt, int i_object_type )
+ es_format_t *fmt, int i_object_type, sout_instance_t *p_sout )
{
decoder_t *p_dec;
decoder_owner_sys_t *p_owner;
p_dec->p_owner->p_vout = NULL;
p_dec->p_owner->p_spu_vout = NULL;
p_dec->p_owner->i_spu_channel = 0;
- p_dec->p_owner->p_sout = p_input->p->p_sout;
+ p_dec->p_owner->p_sout = p_sout;
p_dec->p_owner->p_sout_input = NULL;
p_dec->p_owner->p_packetizer = NULL;