Index: modules/demux/rawdv.c =================================================================== --- modules/demux/rawdv.c (revision 19759) +++ modules/demux/rawdv.c (working copy) @@ -5,6 +5,7 @@ * $Id$ * * Authors: Gildas Bazin + * Paul Corke * * 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 @@ -32,6 +33,9 @@ /***************************************************************************** * Module descriptor *****************************************************************************/ +#define RT_TEXT N_("Realtime") +#define RT_LONGTEXT N_("Allow DV source to send frames when it wants.") + static int Open ( vlc_object_t * ); static void Close( vlc_object_t * ); @@ -41,6 +45,7 @@ set_capability( "demux2", 2 ); set_category( CAT_INPUT ); set_subcategory( SUBCAT_INPUT_DEMUX ); + add_bool( "rawdv-realtime", 0, NULL, RT_TEXT, RT_LONGTEXT, VLC_FALSE ); set_callbacks( Open, Close ); add_shortcut( "rawdv" ); vlc_module_end(); @@ -104,6 +109,7 @@ /* program clock reference (in units of 90kHz) */ mtime_t i_pcr; + vlc_bool_t b_realtime; }; /***************************************************************************** @@ -122,6 +128,7 @@ { demux_t *p_demux = (demux_t*)p_this; demux_sys_t *p_sys; + vlc_value_t val; byte_t *p_peek, *p_peek_backup; @@ -202,6 +209,11 @@ p_demux->pf_control = Control; p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); + var_Create( p_demux, "rawdv-realtime", VLC_VAR_BOOL|VLC_VAR_DOINHERIT ); + var_Get( p_demux, "rawdv-realtime", &val); + p_sys->b_realtime = val.b_bool; + msg_Dbg( p_demux, "Realtime DV Source: %s", (p_sys->b_realtime)?"Yes":"No" ); + p_sys->i_dsf = dv_header.dsf; p_sys->frame_size = dv_header.dsf ? 12 * 150 * 80 : 10 * 150 * 80; p_sys->f_rate = dv_header.dsf ? 25 : 29.97; @@ -278,6 +290,11 @@ block_t *p_block; vlc_bool_t b_audio = VLC_FALSE; + if( p_sys->b_realtime ) + { + p_sys->i_pcr = mdate() + (p_sys->i_dsf ? 120000 : 90000); /* 3 frames */ + } + /* Call the pace control */ es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pcr ); @@ -309,7 +326,10 @@ es_out_Send( p_demux->out, p_sys->p_es_video, p_block ); - p_sys->i_pcr += ( I64C(1000000) / p_sys->f_rate ); + if( !p_sys->b_realtime ) + { + p_sys->i_pcr += ( I64C(1000000) / p_sys->f_rate ); + } return 1; }