/*****************************************************************************
* dec.c : audio output API towards decoders
*****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: dec.c,v 1.13 2003/11/16 21:07:31 gbazin Exp $
+ * Copyright (C) 2002-2004 the VideoLAN team
+ * $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
{
p_input->i_pts_delay = p_input_thread->i_pts_delay;
p_input->i_pts_delay += p_input->i_desync;
+ p_input->p_input_thread = p_input_thread;
vlc_object_release( p_input_thread );
}
else
{
p_input->i_pts_delay = DEFAULT_PTS_DELAY;
p_input->i_pts_delay += p_input->i_desync;
+ p_input->p_input_thread = NULL;
}
return p_input;
{
return NULL;
}
- vlc_object_attach( *pp_aout, p_this->p_vlc );
+ vlc_object_attach( *pp_aout, p_this->p_libvlc );
}
else
{
{
msg_Warn( p_aout, "received buffer in the future ("I64Fd")",
p_buffer->start_date - mdate());
+ if( p_input->p_input_thread )
+ {
+ vlc_mutex_lock( &p_input->p_input_thread->counters.counters_lock);
+ stats_UpdateInteger( p_aout,
+ p_input->p_input_thread->counters.p_lost_abuffers,
+ 1, NULL );
+ vlc_mutex_unlock( &p_input->p_input_thread->counters.counters_lock);
+ }
aout_BufferFree( p_buffer );
return -1;
}
/ p_input->input.i_rate;
aout_BufferAlloc( &p_input->input_alloc, duration, NULL, p_new_buffer );
- p_aout->p_vlc->pf_memcpy( p_new_buffer->p_buffer, p_buffer->p_buffer,
+ p_aout->p_libvlc->pf_memcpy( p_new_buffer->p_buffer, p_buffer->p_buffer,
p_buffer->i_nb_bytes );
p_new_buffer->i_nb_samples = p_buffer->i_nb_samples;
p_new_buffer->i_nb_bytes = p_buffer->i_nb_bytes;
/* Run the mixer if it is able to run. */
vlc_mutex_lock( &p_aout->mixer_lock );
aout_MixerRun( p_aout );
+ if( p_input->p_input_thread )
+ {
+ vlc_mutex_lock( &p_input->p_input_thread->counters.counters_lock);
+ stats_UpdateInteger( p_aout,
+ p_input->p_input_thread->counters.p_played_abuffers,
+ 1, NULL );
+ vlc_mutex_unlock( &p_input->p_input_thread->counters.counters_lock);
+ }
vlc_mutex_unlock( &p_aout->mixer_lock );
return 0;