Commit bd369da1 authored by Gildas Bazin's avatar Gildas Bazin

* src/input/input_clock.c, include/input_ext-intf.h: introduced an i_pts_delay field in
input_thread_t (initialised to DEFAULT_PTS_DELAY).
* modules/access/*: i_pts_delay is now configurable on an access module basis. The pts
delay for http and mms have been raised to 4 * DEFAULT_PTS_DELAY, which is about 1.2
seconds worth of caching.
parent 3260a93c
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* control the pace of reading. * control the pace of reading.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.80 2002/12/06 16:34:03 sam Exp $ * $Id: input_ext-intf.h,v 1.81 2002/12/12 15:10:58 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -305,6 +305,7 @@ struct input_thread_t ...@@ -305,6 +305,7 @@ struct input_thread_t
void (* pf_seek ) ( input_thread_t *, off_t ); void (* pf_seek ) ( input_thread_t *, off_t );
access_sys_t * p_access_data; access_sys_t * p_access_data;
size_t i_mtu; size_t i_mtu;
int i_pts_delay; /* internal caching */
/* Demux module */ /* Demux module */
module_t * p_demux; module_t * p_demux;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* file.c: file input (file: access plug-in) * file.c: file input (file: access plug-in)
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: file.c,v 1.5 2002/11/21 13:53:32 sam Exp $ * $Id: file.c,v 1.6 2002/12/12 15:10:58 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -60,8 +60,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t ); ...@@ -60,8 +60,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define CACHING_TEXT N_("caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for file streams. This " \
"value should be set in miliseconds units." )
vlc_module_begin(); vlc_module_begin();
set_description( _("Standard filesystem file reading") ); set_description( _("Standard filesystem file reading") );
add_category_hint( N_("file"), NULL );
add_integer( "file-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT );
set_capability( "access", 50 ); set_capability( "access", 50 );
add_shortcut( "file" ); add_shortcut( "file" );
add_shortcut( "stream" ); add_shortcut( "stream" );
...@@ -206,6 +213,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -206,6 +213,9 @@ static int Open( vlc_object_t *p_this )
#endif #endif
} }
/* Update default_pts to a suitable value for file access */
p_input->i_pts_delay = config_GetInt( p_input, "file-caching" ) * 1000;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* http.c: HTTP access plug-in * http.c: HTTP access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: http.c,v 1.16 2002/12/11 20:13:50 fenrir Exp $ * $Id: http.c,v 1.17 2002/12/12 15:10:58 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -76,9 +76,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t ); ...@@ -76,9 +76,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t );
"http://myproxy.mydomain:myport . If none is specified, the HTTP_PROXY" \ "http://myproxy.mydomain:myport . If none is specified, the HTTP_PROXY" \
"environment variable will be tried." ) "environment variable will be tried." )
#define CACHING_TEXT N_("caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for http streams. This " \
"value should be set in miliseconds units." )
vlc_module_begin(); vlc_module_begin();
add_category_hint( N_("http"), NULL ); add_category_hint( N_("http"), NULL );
add_string( "http-proxy", NULL, NULL, PROXY_TEXT, PROXY_LONGTEXT ); add_string( "http-proxy", NULL, NULL, PROXY_TEXT, PROXY_LONGTEXT );
add_integer( "http-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT );
set_description( _("HTTP access module") ); set_description( _("HTTP access module") );
set_capability( "access", 0 ); set_capability( "access", 0 );
add_shortcut( "http" ); add_shortcut( "http" );
...@@ -363,7 +369,6 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell ) ...@@ -363,7 +369,6 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell )
if( p_input->stream.p_selected_area->i_size ) if( p_input->stream.p_selected_area->i_size )
{ {
p_input->stream.p_selected_area->i_tell = i_tell; p_input->stream.p_selected_area->i_tell = i_tell;
+ (p_input->p_last_data - p_input->p_current_data);
} }
else else
{ {
...@@ -621,6 +626,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -621,6 +626,9 @@ static int Open( vlc_object_t *p_this )
} }
} }
/* Update default_pts to a suitable value for http access */
p_input->i_pts_delay = config_GetInt( p_input, "http-caching" ) * 1000;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mms.c: MMS access plug-in * mms.c: MMS access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: mms.c,v 1.12 2002/12/06 13:05:22 sam Exp $ * $Id: mms.c,v 1.13 2002/12/12 15:10:58 gbazin Exp $
* *
* Authors: Laurent Aimar <fenrir@via.ecp.fr> * Authors: Laurent Aimar <fenrir@via.ecp.fr>
* *
...@@ -120,10 +120,18 @@ static void mms_ParseURL( url_t *p_url, char *psz_url ); ...@@ -120,10 +120,18 @@ static void mms_ParseURL( url_t *p_url, char *psz_url );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define CACHING_TEXT N_("caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for mms streams. This " \
"value should be set in miliseconds units." )
vlc_module_begin(); vlc_module_begin();
set_description( _("MMS access module") ); set_description( _("MMS access module") );
set_capability( "access", 0 ); set_capability( "access", 0 );
add_category_hint( "stream", NULL ); add_category_hint( "stream", NULL );
add_integer( "mms-caching", 4 * DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT );
add_bool( "mms-all", 0, NULL, add_bool( "mms-all", 0, NULL,
"force selection of all streams", "force selection of all streams",
"force selection of all streams" ); "force selection of all streams" );
...@@ -271,6 +279,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -271,6 +279,9 @@ static int Open( vlc_object_t *p_this )
return( -1 ); return( -1 );
} }
/* Update default_pts to a suitable value for mms access */
p_input->i_pts_delay = config_GetInt( p_input, "mms-caching" ) * 1000;
return( 0 ); return( 0 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* rtp.c: RTP access plug-in * rtp.c: RTP access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: rtp.c,v 1.8 2002/12/11 20:13:50 fenrir Exp $ * $Id: rtp.c,v 1.9 2002/12/12 15:10:58 gbazin Exp $
* *
* Authors: Tristan Leteurtre <tooney@via.ecp.fr> * Authors: Tristan Leteurtre <tooney@via.ecp.fr>
* *
...@@ -69,8 +69,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t ); ...@@ -69,8 +69,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define CACHING_TEXT N_("caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for rtp streams. This " \
"value should be set in miliseconds units." )
vlc_module_begin(); vlc_module_begin();
set_description( _("RTP access module") ); set_description( _("RTP access module") );
add_category_hint( N_("rtp"), NULL );
add_integer( "rtp-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT );
set_capability( "access", 0 ); set_capability( "access", 0 );
add_shortcut( "rtp" ); add_shortcut( "rtp" );
add_shortcut( "rtpstream" ); add_shortcut( "rtpstream" );
...@@ -273,6 +280,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -273,6 +280,9 @@ static int Open( vlc_object_t *p_this )
p_input->psz_demux = "ts"; p_input->psz_demux = "ts";
} }
/* Update default_pts to a suitable value for rtp access */
p_input->i_pts_delay = config_GetInt( p_input, "rtp-caching" ) * 1000;
return( 0 ); return( 0 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* udp.c: raw UDP access plug-in * udp.c: raw UDP access plug-in
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: udp.c,v 1.5 2002/12/11 20:13:50 fenrir Exp $ * $Id: udp.c,v 1.6 2002/12/12 15:10:58 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -62,8 +62,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t ); ...@@ -62,8 +62,15 @@ static ssize_t Read ( input_thread_t *, byte_t *, size_t );
/***************************************************************************** /*****************************************************************************
* Module descriptor * Module descriptor
*****************************************************************************/ *****************************************************************************/
#define CACHING_TEXT N_("caching value in ms")
#define CACHING_LONGTEXT N_( \
"Allows you to modify the default caching value for udp streams. This " \
"value should be set in miliseconds units." )
vlc_module_begin(); vlc_module_begin();
set_description( _("raw UDP access module") ); set_description( _("raw UDP access module") );
add_category_hint( N_("udp"), NULL );
add_integer( "udp-caching", DEFAULT_PTS_DELAY / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT );
set_capability( "access", 0 ); set_capability( "access", 0 );
add_shortcut( "udp" ); add_shortcut( "udp" );
add_shortcut( "udpstream" ); add_shortcut( "udpstream" );
...@@ -262,6 +269,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -262,6 +269,9 @@ static int Open( vlc_object_t *p_this )
p_access_data->i_handle = socket_desc.i_handle; p_access_data->i_handle = socket_desc.i_handle;
p_input->i_mtu = socket_desc.i_mtu; p_input->i_mtu = socket_desc.i_mtu;
/* Update default_pts to a suitable value for udp access */
p_input->i_pts_delay = config_GetInt( p_input, "udp-caching" ) * 1000;
return( 0 ); return( 0 );
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* input_clock.c: Clock/System date convertions, stream management * input_clock.c: Clock/System date convertions, stream management
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: input_clock.c,v 1.35 2002/12/06 10:10:39 sam Exp $ * $Id: input_clock.c,v 1.36 2002/12/12 15:10:58 gbazin Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -319,7 +319,7 @@ mtime_t input_ClockGetTS( input_thread_t * p_input, ...@@ -319,7 +319,7 @@ mtime_t input_ClockGetTS( input_thread_t * p_input,
if( p_pgrm->i_synchro_state == SYNCHRO_OK ) if( p_pgrm->i_synchro_state == SYNCHRO_OK )
{ {
return( ClockToSysdate( p_input, p_pgrm, i_ts + p_pgrm->delta_cr ) return( ClockToSysdate( p_input, p_pgrm, i_ts + p_pgrm->delta_cr )
+ DEFAULT_PTS_DELAY + p_input->i_pts_delay
+ (p_input->p_vlc->i_desync > 0 + (p_input->p_vlc->i_desync > 0
? p_input->p_vlc->i_desync : 0) ); ? p_input->p_vlc->i_desync : 0) );
} }
......
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