Commit 174e0547 authored by Christophe Massiot's avatar Christophe Massiot

* Moved input_DecodePES() to input_dec.c ;

* Fixed an segfault in input_programs.c ;
* Added -fomit-frame-pointer optimization.
parent badd3739
......@@ -106,7 +106,7 @@ ifeq ($(OPTIMS),1)
CFLAGS += -O6
CFLAGS += -ffast-math -funroll-loops -fargument-noalias-global
CFLAGS += -funroll-all-loops -fstrict-aliasing
#CFLAGS += -fomit-frame-pointer
CFLAGS += -fomit-frame-pointer
# Optimizations for x86 familiy
ifneq (,$(findstring 86,$(ARCH)))
......
......@@ -2,7 +2,7 @@
* input_dec.c: Functions for the management of decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_dec.c,v 1.1 2000/12/21 19:24:27 massiot Exp $
* $Id: input_dec.c,v 1.2 2000/12/22 10:58:27 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -31,6 +31,7 @@
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "intf_msg.h"
#include "stream_control.h"
#include "input_ext-dec.h"
......@@ -68,3 +69,29 @@ void input_EndDecoder( decoder_fifo_t * p_decoder_fifo, vlc_thread_t thread_id )
}
}
/*****************************************************************************
* input_DecodePES
*****************************************************************************
* Put a PES in the decoder's fifo.
*****************************************************************************/
void input_DecodePES( decoder_fifo_t * p_decoder_fifo, pes_packet_t * p_pes )
{
vlc_mutex_lock( &p_decoder_fifo->data_lock );
if( !DECODER_FIFO_ISFULL( *p_decoder_fifo ) )
{
p_decoder_fifo->buffer[p_decoder_fifo->i_end] = p_pes;
DECODER_FIFO_INCEND( *p_decoder_fifo );
/* Warn the decoder that it's got work to do. */
vlc_cond_signal( &p_decoder_fifo->data_wait );
}
else
{
/* The FIFO is full !!! This should not happen. */
p_decoder_fifo->pf_delete_pes( p_decoder_fifo->p_packets_mgt,
p_pes );
intf_ErrMsg( "PES trashed - fifo full !" );
}
vlc_mutex_unlock( &p_decoder_fifo->data_lock );
}
......@@ -3,7 +3,7 @@
* decoder
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_dec.h,v 1.1 2000/12/21 19:24:27 massiot Exp $
* $Id: input_dec.h,v 1.2 2000/12/22 10:58:27 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -28,3 +28,4 @@
//decoder_capabilities_s * input_ProbeDecoder( void );
vlc_thread_t input_RunDecoder( struct decoder_capabilities_s *, void * );
void input_EndDecoder( struct decoder_fifo_s *, vlc_thread_t );
void input_DecodePES( struct decoder_fifo_s *, struct pes_packet_s * );
......@@ -3,7 +3,7 @@
* FIXME : check the return value of realloc() and malloc() !
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_programs.c,v 1.13 2000/12/21 19:24:27 massiot Exp $
* $Id: input_programs.c,v 1.14 2000/12/22 10:58:27 massiot Exp $
*
* Authors:
*
......@@ -263,6 +263,10 @@ es_descriptor_t * input_AddES( input_thread_t * p_input,
p_es->p_demux_data = malloc( i_data_len );
memset( p_es->p_demux_data, 0, i_data_len );
}
else
{
p_es->p_demux_data = NULL;
}
/* Add this ES to the program definition if one is given */
if( p_pgrm )
......
......@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mpeg_system.c,v 1.14 2000/12/21 19:24:27 massiot Exp $
* $Id: mpeg_system.c,v 1.15 2000/12/22 10:58:27 massiot Exp $
*
* Authors:
*
......@@ -42,6 +42,7 @@
#include "input.h"
#include "mpeg_system.h"
#include "input_dec.h"
#include "main.h" /* AC3/MPEG channel, SPU channel */
......@@ -54,62 +55,6 @@
* PES Packet management
*/
/*****************************************************************************
* input_DecodePES
*****************************************************************************
* Put a PES in the decoder's fifo.
*****************************************************************************/
void input_DecodePES( input_thread_t * p_input, es_descriptor_t * p_es )
{
#define p_pes (p_es->p_pes)
if( p_es->p_decoder_fifo != NULL )
{
vlc_mutex_lock( &p_es->p_decoder_fifo->data_lock );
#if 0
if( p_input->stream.b_pace_control )
{
/* FIXME : normally we shouldn't need this... */
while( DECODER_FIFO_ISFULL( *p_es->p_decoder_fifo ) )
{
vlc_mutex_unlock( &p_es->p_decoder_fifo->data_lock );
msleep( 20000 );
vlc_mutex_lock( &p_es->p_decoder_fifo->data_lock );
}
}
#endif
if( !DECODER_FIFO_ISFULL( *p_es->p_decoder_fifo ) )
{
//intf_DbgMsg("Putting %p into fifo %p/%d\n",
// p_pes, p_fifo, p_fifo->i_end);
p_es->p_decoder_fifo->buffer[p_es->p_decoder_fifo->i_end] = p_pes;
DECODER_FIFO_INCEND( *p_es->p_decoder_fifo );
/* Warn the decoder that it's got work to do. */
vlc_cond_signal( &p_es->p_decoder_fifo->data_wait );
}
else
{
/* The FIFO is full !!! This should not happen. */
p_input->p_plugin->pf_delete_pes( p_input->p_method_data, p_pes );
intf_ErrMsg( "PES trashed - fifo full ! (%d, %d)",
p_es->i_id, p_es->i_type);
}
vlc_mutex_unlock( &p_es->p_decoder_fifo->data_lock );
}
else
{
intf_ErrMsg("No fifo to receive PES %p (who wrote this damn code ?)",
p_pes);
p_input->p_plugin->pf_delete_pes( p_input->p_method_data, p_pes );
}
p_pes = NULL;
#undef p_pes
}
/*****************************************************************************
* input_ParsePES
*****************************************************************************
......@@ -385,7 +330,17 @@ void input_ParsePES( input_thread_t * p_input, es_descriptor_t * p_es )
/* Now we can eventually put the PES packet in the decoder's
* PES fifo */
input_DecodePES( p_input, p_es );
if( p_es->p_decoder_fifo != NULL )
{
input_DecodePES( p_es->p_decoder_fifo, p_pes );
}
else
{
intf_ErrMsg("No fifo to receive PES %p (who wrote this damn code ?)",
p_pes);
p_input->p_plugin->pf_delete_pes( p_input->p_method_data, p_pes );
}
p_pes = NULL;
}
#undef p_pes
}
......@@ -438,7 +393,7 @@ void input_GatherPES( input_thread_t * p_input, data_packet_t * p_data,
p_pes->p_first = p_pad_data;
p_pes->b_messed_up = p_pes->b_discontinuity = 1;
input_DecodePES( p_input, p_es );
input_DecodePES( p_es->p_decoder_fifo, p_pes );
}
p_es->b_discontinuity = 0;
......
......@@ -3,7 +3,7 @@
* and TS system layers
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: mpeg_system.h,v 1.2 2000/12/20 16:04:31 massiot Exp $
* $Id: mpeg_system.h,v 1.3 2000/12/22 10:58:27 massiot Exp $
*
* Authors:
*
......@@ -111,7 +111,6 @@ typedef struct stream_ps_data_s
/*****************************************************************************
* Prototypes
*****************************************************************************/
void input_DecodePES( struct input_thread_s *, struct es_descriptor_s * );
void input_ParsePES( struct input_thread_s *, struct es_descriptor_s * );
void input_GatherPES( struct input_thread_s *, struct data_packet_s *,
struct es_descriptor_s *, boolean_t, boolean_t );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment