/*****************************************************************************
- * input_dummy.c: dummy input plugin, to manage "vlc:***" special options
+ * demux.c: stats demux plugin
*****************************************************************************
- * Copyright (C) 2001, 2002 the VideoLAN team
- * $Id$
+ * Copyright (C) 2001-2008 the VideoLAN team
*
* Authors: Samuel Hocevar <sam@zoy.org>
+ * Pierre d'Herbemont <pdherbemont@videolan.org>
*
* 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
# include "config.h"
#endif
-#include <vlc/vlc.h>
+#include <vlc_common.h>
#include <vlc_interface.h>
#include <vlc_access.h>
#include <vlc_demux.h>
-#include <vlc_playlist.h>
#include "stats.h"
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
+ p_demux->p_sys = NULL;
+
+ /* Only when selected */
+ if( *p_demux->psz_demux == '\0' )
+ return VLC_EGENERIC;
+
msg_Dbg( p_demux, "Init Stat demux" );
p_demux->pf_demux = Demux;
{
demux_sys_t *p_sys = p_demux->p_sys;
- msg_Dbg( p_demux, "Demux" );
-
block_t * p_block = stream_Block( p_demux->s, kBufferSize );
+ if( !p_block ) return 1;
+
p_block->i_dts = p_block->i_pts =
date_Increment( &p_sys->pts, kBufferSize );
+ msg_Dbg( p_demux, "demux got %d ms offset", (int)(mdate() - *(mtime_t *)p_block->p_buffer) / 1000 );
+
//es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts );
es_out_Send( p_demux->out, p_sys->p_es, p_block );