[vlc-devel] commit: Clip pts_delay from access/demux to 60s. (Laurent Aimar )
git version control
git at videolan.org
Thu Apr 30 22:34:56 CEST 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Apr 30 22:29:08 2009 +0200| [6d9c2bc2d6f40012f068725a117a54888b28e606] | committer: Laurent Aimar
Clip pts_delay from access/demux to 60s.
That plus the fact that the decoder already limit its fifo will allow
to mark all --*-cache options safe.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6d9c2bc2d6f40012f068725a117a54888b28e606
---
src/input/input.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/input/input.c b/src/input/input.c
index dfb27e5..4ff910f 100644
--- a/src/input/input.c
+++ b/src/input/input.c
@@ -110,6 +110,9 @@ static void SubtitleAdd( input_thread_t *p_input, char *psz_subtitle, bool b_for
static void input_ChangeState( input_thread_t *p_input, int i_state ); /* TODO fix name */
+/* Do not let a pts_delay from access/demux go beyong 60s */
+#define INPUT_PTS_DELAY_MAX INT64_C(601000000)
+
/*****************************************************************************
* This function creates a new input, and returns a pointer
* to its description. On error, it returns NULL.
@@ -2370,6 +2373,8 @@ static int InputSourceInit( input_thread_t *p_input,
/* Get infos from access_demux */
demux_Control( in->p_demux,
DEMUX_GET_PTS_DELAY, &in->i_pts_delay );
+ in->i_pts_delay = __MAX( 0, __MIN( in->i_pts_delay, INPUT_PTS_DELAY_MAX ) );
+
in->b_title_demux = true;
if( demux_Control( in->p_demux, DEMUX_GET_TITLE_INFO,
@@ -2440,6 +2445,7 @@ static int InputSourceInit( input_thread_t *p_input,
bool b_can_seek;
access_Control( in->p_access,
ACCESS_GET_PTS_DELAY, &in->i_pts_delay );
+ in->i_pts_delay = __MAX( 0, __MIN( in->i_pts_delay, INPUT_PTS_DELAY_MAX ) );
in->b_title_demux = false;
if( access_Control( in->p_access, ACCESS_GET_TITLE_INFO,
More information about the vlc-devel
mailing list