From bf73ff64ecf2159aabe69d061fedde8e4e268f7b Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Fri, 1 Aug 2003 00:05:07 +0000 Subject: [PATCH] * src/input/input_clock.c: fixed 2 regressions in 0.6.1. These fixes are actually there to make us more complacent with broken streams. * modules/access/dvb/qpsk.c: gettext reserves the use of _(""). * modules/demux/mkv.cpp, modules/demux/avi/libavi.c, modules/demux/mp4/libmp4.c, modules/demux/mpeg/m4v.c: checks for input_SplitBuffer() > 0. (Thanks to Steve Li for pointing this out) --- modules/access/dvb/qpsk.c | 4 ++-- modules/demux/avi/libavi.c | 9 +++------ modules/demux/mkv.cpp | 4 ++-- modules/demux/mp4/libmp4.c | 4 ++-- modules/demux/mpeg/m4v.c | 6 +++--- src/input/input_clock.c | 5 +++-- 6 files changed, 15 insertions(+), 17 deletions(-) diff --git a/modules/access/dvb/qpsk.c b/modules/access/dvb/qpsk.c index 96afef1459..f171e85f40 100644 --- a/modules/access/dvb/qpsk.c +++ b/modules/access/dvb/qpsk.c @@ -41,10 +41,10 @@ void E_(Close) ( vlc_object_t * ); *****************************************************************************/ #define ADAPTER_TEXT N_("adapter card to tune") -#define ADAPTER_LONGTEXT N_("") +#define ADAPTER_LONGTEXT "" #define DEVICE_TEXT N_("device nummer to use on adapter") -#define DEVICE_LONGTEXT N_("") +#define DEVICE_LONGTEXT "" #define FREQ_TEXT N_("satellite default transponder frequency") #define FREQ_LONGTEXT "" diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c index da927c3a02..8d4392961a 100644 --- a/modules/demux/avi/libavi.c +++ b/modules/demux/avi/libavi.c @@ -2,7 +2,7 @@ * libavi.c : ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: libavi.c,v 1.20 2003/05/03 01:12:13 fenrir Exp $ + * $Id: libavi.c,v 1.21 2003/08/01 00:05:07 gbazin Exp $ * Authors: Laurent Aimar * * This program is free software; you can redistribute it and/or modify @@ -129,17 +129,14 @@ int AVI_SeekAbsolute( input_thread_t *p_input, i_read = input_SplitBuffer( p_input, &p_data, __MIN( 4096, i_skip ) ); - if( i_read < 0 ) + if( i_read <= 0 ) { + /* Error or eof */ return VLC_EGENERIC; } i_skip -= i_read; input_DeletePacket( p_input->p_method_data, p_data ); - if( i_read == 0 && i_skip > 0 ) - { - return VLC_EGENERIC; - } } return VLC_SUCCESS; } diff --git a/modules/demux/mkv.cpp b/modules/demux/mkv.cpp index 93fc53627a..8d79b00560 100644 --- a/modules/demux/mkv.cpp +++ b/modules/demux/mkv.cpp @@ -2,7 +2,7 @@ * mkv.cpp : matroska demuxer ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: mkv.cpp,v 1.17 2003/07/04 16:35:20 sam Exp $ + * $Id: mkv.cpp,v 1.18 2003/08/01 00:05:07 gbazin Exp $ * * Authors: Laurent Aimar * @@ -1973,7 +1973,7 @@ void vlc_stream_io_callback::setFilePointer(int64_t i_offset, seek_mode mode ) i_read = input_SplitBuffer( p_input, &p_data, __MIN( 4096, i_skip ) ); - if( i_read < 0 ) + if( i_read <= 0 ) { msg_Err( p_input, "seek failed" ); mb_eof = VLC_TRUE; diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c index 11488a952f..2e4483e9f2 100644 --- a/modules/demux/mp4/libmp4.c +++ b/modules/demux/mp4/libmp4.c @@ -2,7 +2,7 @@ * libmp4.c : LibMP4 library for mp4 module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: libmp4.c,v 1.28 2003/07/19 15:12:10 fenrir Exp $ + * $Id: libmp4.c,v 1.29 2003/08/01 00:05:07 gbazin Exp $ * Authors: Laurent Aimar * * This program is free software; you can redistribute it and/or modify @@ -273,7 +273,7 @@ int MP4_SeekAbsolute( input_thread_t *p_input, i_read = input_SplitBuffer( p_input, &p_data, __MIN( 4096, i_skip ) ); - if( i_read < 0 ) + if( i_read <= 0 ) { msg_Warn( p_input, "seek:cannot read" ); return VLC_EGENERIC; diff --git a/modules/demux/mpeg/m4v.c b/modules/demux/mpeg/m4v.c index 5edf1a4b69..007db52a24 100644 --- a/modules/demux/mpeg/m4v.c +++ b/modules/demux/mpeg/m4v.c @@ -2,7 +2,7 @@ * m4v.c : MPEG-4 video Stream input module for vlc ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: m4v.c,v 1.5 2003/05/05 22:23:36 gbazin Exp $ + * $Id: m4v.c,v 1.6 2003/08/01 00:05:07 gbazin Exp $ * * Authors: Laurent Aimar * @@ -230,7 +230,7 @@ static int Demux( input_thread_t * p_input ) if( ( i_read = input_SplitBuffer( p_input, &p_data, - i_size ) ) < 0 ) + i_size ) ) <= 0 ) { msg_Warn( p_input, "error while reading data" ); break; @@ -262,7 +262,7 @@ static int Demux( input_thread_t * p_input ) if( ( i_read = input_SplitBuffer( p_input, &p_data, - i_size ) ) < 0 ) + i_size ) ) <= 0 ) { msg_Warn( p_input, "error while reading data" ); break; diff --git a/src/input/input_clock.c b/src/input/input_clock.c index 8aab14014b..97add19939 100644 --- a/src/input/input_clock.c +++ b/src/input/input_clock.c @@ -2,7 +2,7 @@ * input_clock.c: Clock/System date convertions, stream management ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_clock.c,v 1.39 2003/07/28 13:19:37 massiot Exp $ + * $Id: input_clock.c,v 1.40 2003/08/01 00:05:07 gbazin Exp $ * * Authors: Christophe Massiot * @@ -75,7 +75,7 @@ static void ClockNewRef( pgrm_descriptor_t * p_pgrm, #define CR_MAX_AVERAGE_COUNTER 40 /* Maximum gap allowed between two CRs. */ -#define CR_MAX_GAP 1000000 +#define CR_MAX_GAP 2000000 /* Latency introduced on DVDs with CR == 0 on chapter change - this is from * my dice --Meuuh */ @@ -239,6 +239,7 @@ void input_ClockManageRef( input_thread_t * p_input, { /* Feed synchro with a new reference point. */ ClockNewRef( p_pgrm, i_clock, + i_clock == 0 ? mdate() : p_pgrm->last_pts + CR_MEAN_PTS_GAP > mdate() ? p_pgrm->last_pts + CR_MEAN_PTS_GAP : mdate() ); p_pgrm->i_synchro_state = SYNCHRO_OK;