/*****************************************************************************
* clock.c: Clock/System date convertions, stream management
*****************************************************************************
- * Copyright (C) 1999-2008 the VideoLAN team
+ * Copyright (C) 1999-2008 VLC authors and VideoLAN
* Copyright (C) 2008 Laurent Aimar
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Laurent Aimar < fenrir _AT_ videolan _DOT_ 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
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
*
- * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
/*****************************************************************************
*****************************************************************************/
/* Maximum gap allowed between two CRs. */
-#define CR_MAX_GAP (INT64_C(2000000)*100/9)
+#define CR_MAX_GAP (60 * CLOCK_FREQ)
/* Latency introduced on DVDs with CR == 0 on chapter change - this is from
* my dice --Meuuh */
*pi_ts0 += i_ts_delay;
}
- /* XXX we do not ipdate i_ts_max on purpose */
+ /* XXX we do not update i_ts_max on purpose */
if( pi_ts1 && *pi_ts1 > VLC_TS_INVALID )
{
*pi_ts1 = ClockStreamToSystem( cl, *pi_ts1 + AvgGet( &cl->drift ) ) +
vlc_mutex_unlock( &cl->lock );
/* Check ts validity */
- if( i_ts_bound != INT64_MAX &&
- *pi_ts0 > VLC_TS_INVALID && *pi_ts0 >= mdate() + i_ts_delay + i_ts_buffering + i_ts_bound )
- return VLC_EGENERIC;
+ if (i_ts_bound != INT64_MAX && *pi_ts0 > VLC_TS_INVALID) {
+ if (*pi_ts0 >= mdate() + i_ts_delay + i_ts_buffering + i_ts_bound) {
+ vlc_Log(NULL, VLC_MSG_ERR, "clock",
+ "Timestamp conversion failed (delay %"PRId64", buffering "
+ "%"PRId64", bound %"PRId64")",
+ i_ts_delay, i_ts_buffering, i_ts_bound);
+ return VLC_EGENERIC;
+ }
+ }
return VLC_SUCCESS;
}