Commit 68d21786 authored by Laurent Aimar's avatar Laurent Aimar

* all: rework of the input.

parent 7d01a7e7
......@@ -25,33 +25,7 @@
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "ninput.h"
int access_vaControl( input_thread_t *p_input, int i_query, va_list args )
{
if( p_input->pf_access_control )
{
return p_input->pf_access_control( p_input, i_query, args );
}
return VLC_EGENERIC;
}
int access_Control( input_thread_t *p_input, int i_query, ... )
{
va_list args;
int i_result;
va_start( args, i_query );
i_result = access_vaControl( p_input, i_query, args );
va_end( args );
return i_result;
}
int access_vaControlDefault( input_thread_t *p_input, int i_query, va_list args )
{
return VLC_EGENERIC;
}
#include "input_internal.h"
/*****************************************************************************
* access2_New:
......
......@@ -24,14 +24,11 @@
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <string.h> /* memcpy(), memset() */
#include <stdlib.h>
#include <vlc/vlc.h>
#include "stream_control.h"
#include "input_ext-intf.h"
#include "input_ext-dec.h"
#include "input_ext-plugins.h"
#include <vlc/input.h>
#include "input_internal.h"
/*
* DISCUSSION : SYNCHRONIZATION METHOD
......@@ -67,7 +64,8 @@
* new_average = (old_average * c_average + new_sample_value) / (c_average +1)
*/
static void ClockNewRef( pgrm_descriptor_t * p_pgrm,
static void ClockNewRef( input_clock_t * p_pgrm,
mtime_t i_clock, mtime_t i_sysdate );
/*****************************************************************************
......@@ -84,19 +82,19 @@ static void ClockNewRef( pgrm_descriptor_t * p_pgrm,
/*****************************************************************************
* ClockToSysdate: converts a movie clock to system date
*****************************************************************************/
static mtime_t ClockToSysdate( input_thread_t * p_input,
pgrm_descriptor_t * p_pgrm, mtime_t i_clock )
static mtime_t ClockToSysdate( input_thread_t *p_input,
input_clock_t *cl, mtime_t i_clock )
{
mtime_t i_sysdate = 0;
if( p_pgrm->i_synchro_state == SYNCHRO_OK )
if( cl->i_synchro_state == SYNCHRO_OK )
{
i_sysdate = (mtime_t)(i_clock - p_pgrm->cr_ref)
* (mtime_t)p_input->stream.control.i_rate
i_sysdate = (mtime_t)(i_clock - cl->cr_ref)
* (mtime_t)p_input->i_rate
* (mtime_t)300;
i_sysdate /= 27;
i_sysdate /= 1000;
i_sysdate += (mtime_t)p_pgrm->sysdate_ref;
i_sysdate += (mtime_t)cl->sysdate_ref;
}
return( i_sysdate );
......@@ -107,46 +105,54 @@ static mtime_t ClockToSysdate( input_thread_t * p_input,
*****************************************************************************
* Caution : the synchro state must be SYNCHRO_OK for this to operate.
*****************************************************************************/
static mtime_t ClockCurrent( input_thread_t * p_input,
pgrm_descriptor_t * p_pgrm )
static mtime_t ClockCurrent( input_thread_t *p_input,
input_clock_t *cl )
{
return( (mdate() - p_pgrm->sysdate_ref) * 27 * DEFAULT_RATE
/ p_input->stream.control.i_rate / 300
+ p_pgrm->cr_ref );
return( (mdate() - cl->sysdate_ref) * 27 * INPUT_RATE_DEFAULT
/ p_input->i_rate / 300
+ cl->cr_ref );
}
/*****************************************************************************
* ClockNewRef: writes a new clock reference
*****************************************************************************/
static void ClockNewRef( pgrm_descriptor_t * p_pgrm,
static void ClockNewRef( input_clock_t *cl,
mtime_t i_clock, mtime_t i_sysdate )
{
p_pgrm->cr_ref = i_clock;
p_pgrm->sysdate_ref = i_sysdate ;
cl->cr_ref = i_clock;
cl->sysdate_ref = i_sysdate ;
}
/*****************************************************************************
* input_ClockInit: reinitializes the clock reference after a stream
* discontinuity
*****************************************************************************/
void input_ClockInit( pgrm_descriptor_t * p_pgrm )
void input_ClockInit( input_clock_t *cl, vlc_bool_t b_master, int i_cr_average )
{
p_pgrm->last_cr = 0;
p_pgrm->last_pts = 0;
p_pgrm->cr_ref = 0;
p_pgrm->sysdate_ref = 0;
p_pgrm->delta_cr = 0;
p_pgrm->c_average_count = 0;
cl->i_synchro_state = SYNCHRO_START;
cl->last_cr = 0;
cl->last_pts = 0;
cl->cr_ref = 0;
cl->sysdate_ref = 0;
cl->delta_cr = 0;
cl->c_average_count = 0;
cl->i_cr_average = i_cr_average;
cl->b_master = b_master;
}
#if 0
/*****************************************************************************
* input_ClockManageControl: handles the messages from the interface
*****************************************************************************
* Returns UNDEF_S if nothing happened, PAUSE_S if the stream was paused
*****************************************************************************/
int input_ClockManageControl( input_thread_t * p_input,
pgrm_descriptor_t * p_pgrm, mtime_t i_clock )
input_clock_t *cl, mtime_t i_clock )
{
#if 0
vlc_value_t val;
int i_return_value = UNDEF_S;
......@@ -221,36 +227,32 @@ int input_ClockManageControl( input_thread_t * p_input,
vlc_mutex_unlock( &p_input->stream.stream_lock );
return( i_return_value );
#endif
return UNDEF_S;
}
#endif
/*****************************************************************************
* input_ClockManageRef: manages a clock reference
* input_ClockSetPCR: manages a clock reference
*****************************************************************************/
void input_ClockManageRef( input_thread_t * p_input,
pgrm_descriptor_t * p_pgrm, mtime_t i_clock )
void input_ClockSetPCR( input_thread_t *p_input,
input_clock_t *cl, mtime_t i_clock )
{
/* take selected program if none specified */
if( !p_pgrm )
{
p_pgrm = p_input->stream.p_selected_program;
}
if( ( p_pgrm->i_synchro_state != SYNCHRO_OK ) ||
( i_clock == 0 && p_pgrm->last_cr != 0 ) )
if( ( cl->i_synchro_state != SYNCHRO_OK ) ||
( i_clock == 0 && cl->last_cr != 0 ) )
{
/* Feed synchro with a new reference point. */
ClockNewRef( p_pgrm, i_clock,
p_pgrm->last_pts + CR_MEAN_PTS_GAP > mdate() ?
p_pgrm->last_pts + CR_MEAN_PTS_GAP : mdate() );
p_pgrm->i_synchro_state = SYNCHRO_OK;
ClockNewRef( cl, i_clock,
cl->last_pts + CR_MEAN_PTS_GAP > mdate() ?
cl->last_pts + CR_MEAN_PTS_GAP : mdate() );
cl->i_synchro_state = SYNCHRO_OK;
if( p_input->stream.b_pace_control
&& p_input->stream.p_selected_program == p_pgrm )
if( p_input->b_can_pace_control && cl->b_master )
{
p_pgrm->last_cr = i_clock;
cl->last_cr = i_clock;
if( !p_input->b_out_pace_control )
{
mtime_t i_wakeup = ClockToSysdate( p_input, p_pgrm, i_clock );
mtime_t i_wakeup = ClockToSysdate( p_input, cl, i_clock );
while( (i_wakeup - mdate()) / CLOCK_FREQ > 1 )
{
msleep( CLOCK_FREQ );
......@@ -261,37 +263,38 @@ void input_ClockManageRef( input_thread_t * p_input,
}
else
{
p_pgrm->last_cr = 0;
p_pgrm->delta_cr = 0;
p_pgrm->c_average_count = 0;
cl->last_cr = 0;
cl->delta_cr = 0;
cl->c_average_count = 0;
}
}
else
{
if ( p_pgrm->last_cr != 0 &&
( (p_pgrm->last_cr - i_clock) > CR_MAX_GAP
|| (p_pgrm->last_cr - i_clock) < - CR_MAX_GAP ) )
if ( cl->last_cr != 0 &&
( (cl->last_cr - i_clock) > CR_MAX_GAP
|| (cl->last_cr - i_clock) < - CR_MAX_GAP ) )
{
/* Stream discontinuity, for which we haven't received a
* warning from the stream control facilities (dd-edited
* stream ?). */
msg_Warn( p_input, "clock gap, unexpected stream discontinuity" );
input_ClockInit( p_pgrm );
p_pgrm->i_synchro_state = SYNCHRO_START;
input_ClockInit( cl, cl->b_master, cl->i_cr_average );
/* FIXME needed ? */
#if 0
input_EscapeDiscontinuity( p_input );
#endif
}
p_pgrm->last_cr = i_clock;
cl->last_cr = i_clock;
if( p_input->stream.b_pace_control
&& p_input->stream.p_selected_program == p_pgrm )
if( p_input->b_can_pace_control && cl->b_master )
{
/* Wait a while before delivering the packets to the decoder.
* In case of multiple programs, we arbitrarily follow the
* clock of the selected program. */
if( !p_input->b_out_pace_control )
{
mtime_t i_wakeup = ClockToSysdate( p_input, p_pgrm, i_clock );
mtime_t i_wakeup = ClockToSysdate( p_input, cl, i_clock );
while( (i_wakeup - mdate()) / CLOCK_FREQ > 1 )
{
msleep( CLOCK_FREQ );
......@@ -299,30 +302,32 @@ void input_ClockManageRef( input_thread_t * p_input,
}
mwait( i_wakeup );
}
/* FIXME Not needed anymore ? */
#if 0
/* Now take into account interface changes. */
input_ClockManageControl( p_input, p_pgrm, i_clock );
input_ClockManageControl( p_input, cl, i_clock );
#endif
}
else
{
/* Smooth clock reference variations. */
mtime_t i_extrapoled_clock = ClockCurrent( p_input, p_pgrm );
mtime_t i_extrapoled_clock = ClockCurrent( p_input, cl );
/* Bresenham algorithm to smooth variations. */
if( p_pgrm->c_average_count == p_input->i_cr_average )
if( cl->c_average_count == cl->i_cr_average )
{
p_pgrm->delta_cr = ( p_pgrm->delta_cr
* (p_input->i_cr_average - 1)
cl->delta_cr = ( cl->delta_cr
* (cl->i_cr_average - 1)
+ ( i_extrapoled_clock - i_clock ) )
/ p_input->i_cr_average;
/ cl->i_cr_average;
}
else
{
p_pgrm->delta_cr = ( p_pgrm->delta_cr
* p_pgrm->c_average_count
cl->delta_cr = ( cl->delta_cr
* cl->c_average_count
+ ( i_extrapoled_clock - i_clock ) )
/ (p_pgrm->c_average_count + 1);
p_pgrm->c_average_count++;
/ (cl->c_average_count + 1);
cl->c_average_count++;
}
}
}
......@@ -332,23 +337,12 @@ void input_ClockManageRef( input_thread_t * p_input,
* input_ClockGetTS: manages a PTS or DTS
*****************************************************************************/
mtime_t input_ClockGetTS( input_thread_t * p_input,
pgrm_descriptor_t * p_pgrm, mtime_t i_ts )
input_clock_t *cl, mtime_t i_ts )
{
/* take selected program if none specified */
if( !p_pgrm )
{
p_pgrm = p_input->stream.p_selected_program;
}
if( p_pgrm->i_synchro_state == SYNCHRO_OK )
{
p_pgrm->last_pts = ClockToSysdate( p_input, p_pgrm,
i_ts + p_pgrm->delta_cr );
return( p_pgrm->last_pts + p_input->i_pts_delay );
}
else
{
if( cl->i_synchro_state != SYNCHRO_OK )
return 0;
}
cl->last_pts = ClockToSysdate( p_input, cl, i_ts + cl->delta_cr );
return cl->last_pts + p_input->i_pts_delay;
}
......@@ -22,22 +22,12 @@
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "input_internal.h"
#include "vlc_playlist.h"
#include "ninput.h"
#include "../../modules/demux/util/sub.h"
struct input_thread_sys_t
{
/* subtitles */
int i_sub;
subtitle_demux_t **sub;
int64_t i_stop_time;
};
static void UpdateBookmarksOption( input_thread_t * );
......@@ -64,7 +54,6 @@ int input_Control( input_thread_t *p_input, int i_query, ... )
int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
{
int i_ret;
seekpoint_t *p_bkmk, ***ppp_bkmk;
int i_bkmk = 0;
int *pi_bkmk;
......@@ -75,54 +64,50 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
double f, *pf;
int64_t i_64, *pi_64;
vlc_mutex_lock( &p_input->stream.stream_lock );
switch( i_query )
{
case INPUT_GET_POSITION:
pf = (double*)va_arg( args, double * );
*pf = var_GetFloat( p_input, "position" );
i_ret = VLC_SUCCESS;
break;
return VLC_SUCCESS;
case INPUT_SET_POSITION:
f = (double)va_arg( args, double );
i_ret = var_SetFloat( p_input, "position", f );
break;
return var_SetFloat( p_input, "position", f );
case INPUT_GET_LENGTH:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = var_GetTime( p_input, "length" );
i_ret = VLC_SUCCESS;
break;
return VLC_SUCCESS;
case INPUT_GET_TIME:
pi_64 = (int64_t*)va_arg( args, int64_t * );
*pi_64 = var_GetTime( p_input, "time" );
i_ret = VLC_SUCCESS;
break;
return VLC_SUCCESS;
case INPUT_SET_TIME:
i_64 = (int64_t)va_arg( args, int64_t );
i_ret = var_SetTime( p_input, "time", i_64 );
break;
return var_SetTime( p_input, "time", i_64 );
case INPUT_GET_RATE:
pi_int = (int*)va_arg( args, int * );
*pi_int = var_GetInteger( p_input, "rate" );
i_ret = VLC_SUCCESS;
break;
return VLC_SUCCESS;
case INPUT_SET_RATE:
i_int = (int)va_arg( args, int );
i_ret = var_SetInteger( p_input, "rate", i_int );
break;
return var_SetInteger( p_input, "rate", i_int );
case INPUT_GET_STATE:
pi_int = (int*)va_arg( args, int * );
*pi_int = var_GetInteger( p_input, "state" );
i_ret = VLC_SUCCESS;
break;
return VLC_SUCCESS;
case INPUT_SET_STATE:
i_int = (int)va_arg( args, int );
i_ret = var_SetInteger( p_input, "state", i_int );
break;
return var_SetInteger( p_input, "state", i_int );
#if 0
case INPUT_ADD_OPTION:
{
psz_option = (char *)va_arg( args, char * );
......@@ -130,7 +115,7 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
i_ret = VLC_EGENERIC;
vlc_mutex_lock( &p_input->p_item->lock );
/* Check if option already exists */
/* Check if option already exists */
for( i = 0; i < p_input->p_item->i_options; i++ )
{
if( !strncmp( p_input->p_item->ppsz_options[i], psz_option,
......@@ -500,22 +485,33 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
i_ret = VLC_EGENERIC;
}
break;
#endif
case INPUT_GET_BOOKMARKS:
case INPUT_CLEAR_BOOKMARKS:
case INPUT_ADD_BOOKMARK:
case INPUT_CHANGE_BOOKMARK:
case INPUT_DEL_BOOKMARK:
case INPUT_SET_BOOKMARK:
case INPUT_ADD_OPTION:
case INPUT_ADD_INFO:
case INPUT_GET_INFO:
case INPUT_SET_NAME:
case INPUT_GET_SUBDELAY:
case INPUT_SET_SUBDELAY:
/* FIXME */
msg_Err( p_input, "unimplemented query in input_vaControl" );
default:
msg_Err( p_input, "unknown query in input_vaControl" );
i_ret = VLC_EGENERIC;
break;
return VLC_EGENERIC;
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
return i_ret;
}
static void UpdateBookmarksOption( input_thread_t *p_input )
{
int i, i_len = 0;
char *psz_value = NULL, *psz_next = NULL;
/* FIXME */
#if 0
vlc_mutex_unlock( &p_input->stream.stream_lock );
for( i = 0; i < p_input->i_bookmarks; i++ )
......@@ -546,4 +542,5 @@ static void UpdateBookmarksOption( input_thread_t *p_input )
psz_value ? psz_value : "" );
vlc_mutex_lock( &p_input->stream.stream_lock );
#endif
}
/*****************************************************************************
* input_dec.c: Functions for the management of decoders
* decoder.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Gildas Bazin <gbazin@netcourrier.com>
* Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -26,25 +27,20 @@
* Preamble
*****************************************************************************/
#include <stdlib.h>
#include <string.h> /* memcpy(), memset() */
#include <vlc/vlc.h>
#include <vlc/decoder.h>
#include <vlc/vout.h>
#include <vlc/input.h>
#include "stream_output.h"
#include "input_internal.h"
#include "input_ext-intf.h"
#include "input_ext-plugins.h"
#include "codecs.h"
static void input_NullPacket( input_thread_t *, es_descriptor_t * );
static decoder_t * CreateDecoder( input_thread_t *, es_format_t *, int );
static void DeleteDecoder( decoder_t * );
static decoder_t * CreateDecoder( input_thread_t *, es_descriptor_t *, int );
static int DecoderThread( decoder_t * );
static int DecoderDecode( decoder_t * p_dec, block_t *p_block );
static void DeleteDecoder( decoder_t * );
/* Buffers allocation callbacks for the decoders */
static aout_buffer_t *aout_new_buffer( decoder_t *, int );
......@@ -81,10 +77,6 @@ struct decoder_owner_sys_t
/* fifo */
block_fifo_t *p_fifo;
/* */
input_buffers_t *p_method_data;
es_descriptor_t *p_es_descriptor;
};
......@@ -95,16 +87,17 @@ struct decoder_owner_sys_t
* \param p_es the es descriptor
* \return the spawned decoder object
*/
decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
decoder_t *input_DecoderNew( input_thread_t *p_input,
es_format_t *fmt, vlc_bool_t b_force_decoder )
{
decoder_t *p_dec = NULL;
vlc_value_t val;
/* If we are in sout mode, search for packetizer module */
if( !p_es->b_force_decoder && p_input->stream.p_sout )
if( p_input->p_sout && !b_force_decoder )
{
/* Create the decoder configuration structure */
p_dec = CreateDecoder( p_input, p_es, VLC_OBJECT_PACKETIZER );
p_dec = CreateDecoder( p_input, fmt, VLC_OBJECT_PACKETIZER );
if( p_dec == NULL )
{
msg_Err( p_input, "could not create packetizer" );
......@@ -114,7 +107,7 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
else
{
/* Create the decoder configuration structure */
p_dec = CreateDecoder( p_input, p_es, VLC_OBJECT_DECODER );
p_dec = CreateDecoder( p_input, fmt, VLC_OBJECT_DECODER );
if( p_dec == NULL )
{
msg_Err( p_input, "could not create decoder" );
......@@ -133,7 +126,8 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
return NULL;
}
if( !p_es->b_force_decoder && p_input->stream.p_sout && p_input->stream.b_pace_control )
if( p_input->p_sout && p_input->input.b_can_pace_control &&
!b_force_decoder )
{
msg_Dbg( p_input, "stream out mode -> no decoder thread" );
p_dec->p_owner->b_own_thread = VLC_FALSE;
......@@ -147,14 +141,10 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
if( p_dec->p_owner->b_own_thread )
{
int i_priority;
if ( p_es->i_cat == AUDIO_ES )
{
if( fmt->i_cat == AUDIO_ES )
i_priority = VLC_THREAD_PRIORITY_AUDIO;
}
else
{
i_priority = VLC_THREAD_PRIORITY_VIDEO;
}
/* Spawn the decoder thread */
if( vlc_thread_create( p_dec, "decoder", DecoderThread,
......@@ -169,14 +159,6 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
}
}
/* Select a new ES */
INSERT_ELEM( p_input->stream.pp_selected_es,
p_input->stream.i_selected_es_number,
p_input->stream.i_selected_es_number,
p_es );
p_input->stream.b_changed = 1;
return p_dec;
}
......@@ -187,10 +169,8 @@ decoder_t * input_RunDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
* \param p_es the es descriptor
* \return nothing
*/
void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
void input_DecoderDelete( decoder_t *p_dec )
{
decoder_t *p_dec = p_es->p_dec;
p_dec->b_die = VLC_TRUE;
if( p_dec->p_owner->b_own_thread )
......@@ -198,7 +178,7 @@ void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
/* Make sure the thread leaves the function by
* sending it an empty block. */
block_t *p_block = block_New( p_dec, 0 );
input_DecodeBlock( p_dec, p_block );
input_DecoderDecode( p_dec, p_block );
vlc_thread_join( p_dec );
......@@ -215,55 +195,6 @@ void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es )
/* Delete the decoder */
vlc_object_destroy( p_dec );
/* Tell the input there is no more decoder */
p_es->p_dec = NULL;
p_input->stream.b_changed = 1;
}
/**
* Put a PES in the decoder's fifo.
*
* \param p_dec the decoder object
* \param p_pes the pes packet
* \return nothing
*/
void input_DecodePES( decoder_t * p_dec, pes_packet_t * p_pes )
{
data_packet_t *p_data;
int i_size = 0;
for( p_data = p_pes->p_first; p_data != NULL; p_data = p_data->p_next )
{
i_size += p_data->p_payload_end - p_data->p_payload_start;
}
if( i_size > 0 )
{
block_t *p_block = block_New( p_dec, i_size );
if( p_block )
{
uint8_t *p_buffer = p_block->p_buffer;
for( p_data = p_pes->p_first; p_data; p_data = p_data->p_next )
{
int i_copy = p_data->p_payload_end - p_data->p_payload_start;
memcpy( p_buffer, p_data->p_payload_start, i_copy );
p_buffer += i_copy;
}
p_block->i_pts = p_pes->i_pts;
p_block->i_dts = p_pes->i_dts;
if( p_pes->b_discontinuity )
p_block->i_flags |= BLOCK_FLAG_DISCONTINUITY;
p_block->i_rate = p_pes->i_rate;
input_DecodeBlock( p_dec, p_block );
}
}
input_DeletePES( p_dec->p_owner->p_method_data, p_pes );
}
/**
......@@ -272,7 +203,7 @@ void input_DecodePES( decoder_t * p_dec, pes_packet_t * p_pes )
* \param p_dec the decoder object
* \param p_block the data block
*/
void input_DecodeBlock( decoder_t * p_dec, block_t *p_block )
void input_DecoderDecode( decoder_t * p_dec, block_t *p_block )
{
if( p_dec->p_owner->b_own_thread )
{
......@@ -301,6 +232,25 @@ void input_DecodeBlock( decoder_t * p_dec, block_t *p_block )
}
}
void input_DecoderDiscontinuity( decoder_t * p_dec )
{
block_t *p_null;
/* Empty the fifo */
if( p_dec->p_owner->b_own_thread )
{
block_FifoEmpty( p_dec->p_owner->p_fifo );
}
/* Send a special block */
p_null = block_New( p_dec, 128 );
p_null->i_flags |= BLOCK_FLAG_DISCONTINUITY;
memset( p_null->p_buffer, 0, p_null->i_buffer );
input_DecoderDecode( p_dec, p_null );
}
#if 0
/**
* Create a NULL packet for padding in case of a data loss
*
......@@ -311,6 +261,7 @@ void input_DecodeBlock( decoder_t * p_dec, block_t *p_block )
static void input_NullPacket( input_thread_t * p_input,
es_descriptor_t * p_es )
{
#if 0
block_t *p_block = block_New( p_input, PADDING_PACKET_SIZE );
if( p_block )
{
......@@ -319,6 +270,7 @@ static void input_NullPacket( input_thread_t * p_input,
block_FifoPut( p_es->p_dec->p_owner->p_fifo, p_block );
}
#endif
}
/**
......@@ -329,6 +281,7 @@ static void input_NullPacket( input_thread_t * p_input,
*/
void input_EscapeDiscontinuity( input_thread_t * p_input )
{
#if 0
unsigned int i_es, i;
for( i_es = 0; i_es < p_input->stream.i_selected_es_number; i_es++ )
......@@ -343,6 +296,7 @@ void input_EscapeDiscontinuity( input_thread_t * p_input )
}
}
}
#endif
}
/**
......@@ -353,6 +307,7 @@ void input_EscapeDiscontinuity( input_thread_t * p_input )