From a408beace67ef9245bf8d81bb59689bd53e7a21e Mon Sep 17 00:00:00 2001 From: Laurent Aimar Date: Fri, 10 Oct 2008 21:24:32 +0200 Subject: [PATCH] Fixed invalid/useless usage of ES_OUT_RESET_PCR. --- include/vlc_es_out.h | 5 ++--- modules/demux/avformat/demux.c | 3 --- modules/demux/gme.cpp | 2 -- modules/demux/live555.cpp | 2 -- modules/demux/mkv/mkv.cpp | 8 ++------ modules/demux/mod.c | 2 -- modules/demux/nsv.c | 4 +--- modules/demux/ps.c | 2 -- modules/demux/pva.c | 1 - modules/demux/real.c | 4 ---- modules/demux/ts.c | 4 +--- modules/demux/tta.c | 1 - modules/demux/ty.c | 1 - 13 files changed, 6 insertions(+), 33 deletions(-) diff --git a/include/vlc_es_out.h b/include/vlc_es_out.h index 0ef457b07f..08e75eb9cf 100644 --- a/include/vlc_es_out.h +++ b/include/vlc_es_out.h @@ -71,9 +71,8 @@ enum es_out_query_e /* PCR handling, DTS/PTS will be automatically computed using thoses PCR * XXX: SET_PCR(_GROUP) are in charge of the pace control. They will wait * to slow down the demuxer so that it reads at the right speed. - * XXX: if you want PREROLL just call RESET_PCR and - * ES_OUT_SET_NEXT_DISPLAY_TIME and send data to the decoder *without* - * calling SET_PCR until preroll is finished. + * XXX: if you want PREROLL just call ES_OUT_SET_NEXT_DISPLAY_TIME and send$ + * as you would normally do. */ ES_OUT_SET_PCR, /* arg1=int64_t i_pcr(microsecond!) (using default group 0)*/ ES_OUT_SET_GROUP_PCR, /* arg1= int i_group, arg2=int64_t i_pcr(microsecond!)*/ diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c index f093079c5d..1658122bbd 100644 --- a/modules/demux/avformat/demux.c +++ b/modules/demux/avformat/demux.c @@ -509,7 +509,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) return VLC_EGENERIC; } UpdateSeekPoint( p_demux, i64 ); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); p_sys->i_pcr = -1; /* Invalidate time display */ } return VLC_SUCCESS; @@ -540,7 +539,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) { return VLC_EGENERIC; } - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); p_sys->i_pcr = -1; /* Invalidate time display */ UpdateSeekPoint( p_demux, i64 ); return VLC_SUCCESS; @@ -626,7 +624,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) { return VLC_EGENERIC; } - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); p_sys->i_pcr = -1; /* Invalidate time display */ UpdateSeekPoint( p_demux, i64 ); return VLC_SUCCESS; diff --git a/modules/demux/gme.cpp b/modules/demux/gme.cpp index de1c285d0f..2dfb5c957a 100644 --- a/modules/demux/gme.cpp +++ b/modules/demux/gme.cpp @@ -420,7 +420,6 @@ switch( i_query ) { ModPlug_Seek( p_sys->f, i64 / 1000 ); p_sys->i_time = i64 + 1; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); return VLC_SUCCESS; } @@ -443,7 +442,6 @@ switch( i_query ) { ModPlug_Seek( p_sys->f, i64 / 1000 ); p_sys->i_time = i64 + 1; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); return VLC_SUCCESS; } diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp index fd4d69d9b7..687dc882ef 100644 --- a/modules/demux/live555.cpp +++ b/modules/demux/live555.cpp @@ -1252,7 +1252,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) p_sys->env->getResultMsg() ); return VLC_EGENERIC; } - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); p_sys->i_pcr = 0; /* Retrieve RTP-Info values */ @@ -1338,7 +1337,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) p_sys->i_npt_start = 0; p_sys->i_pcr = 0; p_sys->i_npt = 0.; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); *pi_int = (int)( INPUT_RATE_DEFAULT / p_sys->ms->scale() + 0.5 ); return VLC_SUCCESS; diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp index 338732ff5b..2c1e967345 100644 --- a/modules/demux/mkv/mkv.cpp +++ b/modules/demux/mkv/mkv.cpp @@ -649,7 +649,6 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_ { ParseCluster(); msg_Dbg( &sys.demuxer, "we found a cluster that is in the neighbourhood" ); - es_out_Control( sys.demuxer.out, ES_OUT_RESET_PCR ); return; } } @@ -690,8 +689,6 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_ sys.i_start_pts = i_date; - es_out_Control( sys.demuxer.out, ES_OUT_RESET_PCR ); - /* now parse until key frame */ i_track_skipping = 0; for( i_track = 0; i_track < tracks.size(); i_track++ ) @@ -744,7 +741,6 @@ void matroska_segment_c::Seek( mtime_t i_date, mtime_t i_time_offset, int64_t i_ } if( !tracks[i_track]->b_search_keyframe ) { - //es_out_Control( sys.demuxer.out, ES_OUT_SET_PCR, sys.i_pts ); BlockDecode( &sys.demuxer, block, simpleblock, sys.i_pts, 0, i_block_ref1 >= 0 || i_block_ref2 > 0 ); } } @@ -865,10 +861,10 @@ static int Demux( demux_t *p_demux) else p_sys->i_pts = (p_sys->i_chapter_time + block->GlobalTimecode()) / (mtime_t) 1000; + es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pts ); + if( p_sys->i_pts >= p_sys->i_start_pts ) { - es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_sys->i_pts ); - if ( p_vsegment->UpdateCurrentToChapter( *p_demux ) ) { i_return = 1; diff --git a/modules/demux/mod.c b/modules/demux/mod.c index 399bc00ab9..69128ecc99 100644 --- a/modules/demux/mod.c +++ b/modules/demux/mod.c @@ -327,7 +327,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) { ModPlug_Seek( p_sys->f, i64 / 1000 ); p_sys->i_time = i64 + 1; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); return VLC_SUCCESS; } @@ -350,7 +349,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) { ModPlug_Seek( p_sys->f, i64 / 1000 ); p_sys->i_time = i64 + 1; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); return VLC_SUCCESS; } diff --git a/modules/demux/nsv.c b/modules/demux/nsv.c index c50579ffc1..8af188efc6 100644 --- a/modules/demux/nsv.c +++ b/modules/demux/nsv.c @@ -343,11 +343,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) f = (double) va_arg( args, double ); i64 = stream_Size( p_demux->s ); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); if( stream_Seek( p_demux->s, (int64_t)(i64 * f) ) || ReSynch( p_demux ) ) - { return VLC_EGENERIC; - } + p_sys->i_time = -1; /* Invalidate time display */ return VLC_SUCCESS; diff --git a/modules/demux/ps.c b/modules/demux/ps.c index 837a8ce31c..274dc0bfee 100644 --- a/modules/demux/ps.c +++ b/modules/demux/ps.c @@ -449,7 +449,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) f = (double) va_arg( args, double ); i64 = stream_Size( p_demux->s ); p_sys->i_current_pts = 0; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); return stream_Seek( p_demux->s, (int64_t)(i64 * f) ); @@ -494,7 +493,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) int64_t i_offset = i_pos / (i_now / 1000000) * ((i64 - i_now) / 1000000); stream_Seek( p_demux->s, i_pos + i_offset); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); return VLC_SUCCESS; } return VLC_EGENERIC; diff --git a/modules/demux/pva.c b/modules/demux/pva.c index 09eaf303e5..a3f13a01fb 100644 --- a/modules/demux/pva.c +++ b/modules/demux/pva.c @@ -294,7 +294,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) f = (double) va_arg( args, double ); i64 = stream_Size( p_demux->s ); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); if( stream_Seek( p_demux->s, (int64_t)(i64 * f) ) || ReSynch( p_demux ) ) { return VLC_EGENERIC; diff --git a/modules/demux/real.c b/modules/demux/real.c index f7b71e35b6..8d6fa6c17f 100644 --- a/modules/demux/real.c +++ b/modules/demux/real.c @@ -794,7 +794,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) msg_Dbg(p_demux, "Seek in real rtsp stream!"); p_sys->i_pcr = (int64_t)1000 * ( p_sys->i_our_duration * f ); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR , p_sys->i_pcr ); p_sys->b_seek = 1; return stream_Seek( p_demux->s, p_sys->i_pcr ); @@ -819,8 +818,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) p_sys->i_pcr = 1000 * (int64_t) p_index->time_offset; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR , p_sys->i_pcr ); - return stream_Seek( p_demux->s, i64 ); } case DEMUX_SET_TIME: @@ -840,7 +837,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) } p_sys->i_pcr = 1000 * (int64_t) p_index->time_offset; - es_out_Control( p_demux->out, ES_OUT_RESET_PCR , p_sys->i_pcr ); return stream_Seek( p_demux->s, i64 ); diff --git a/modules/demux/ts.c b/modules/demux/ts.c index 92889d6bbc..57d9198073 100644 --- a/modules/demux/ts.c +++ b/modules/demux/ts.c @@ -1235,11 +1235,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) f = (double) va_arg( args, double ); i64 = stream_Size( p_demux->s ); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); if( stream_Seek( p_demux->s, (int64_t)(i64 * f) ) ) - { return VLC_EGENERIC; - } + return VLC_SUCCESS; #if 0 diff --git a/modules/demux/tta.c b/modules/demux/tta.c index bc7ae25a70..eca6ac5fba 100644 --- a/modules/demux/tta.c +++ b/modules/demux/tta.c @@ -236,7 +236,6 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) case DEMUX_SET_POSITION: f = (double)va_arg( args, double ); i64 = (int64_t)(f * (stream_Size( p_demux->s ) - p_sys->i_start)); - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); if( i64 > 0 ) { int64_t tmp = 0; diff --git a/modules/demux/ty.c b/modules/demux/ty.c index 231fddabf8..7e3a2a42d6 100644 --- a/modules/demux/ty.c +++ b/modules/demux/ty.c @@ -1104,7 +1104,6 @@ static int ty_stream_seek_pct(demux_t *p_demux, double seek_pct) /* to hell with syncing any audio or video, just start reading records... :) */ /*p_sys->lastAudioPTS = p_sys->lastVideoPTS = 0;*/ - es_out_Control( p_demux->out, ES_OUT_RESET_PCR ); return VLC_SUCCESS; } -- 2.39.2