[vlc-devel] [PATCH 4/5] mkv: call ES_OUT_RESET_PCR when seeking in the segment

Denis Charmet typx at dinauz.org
Thu Mar 17 17:55:17 CET 2016


On 2016-03-17 17:47, Steve Lhomme wrote:
> ---
>  modules/demux/mkv/demux.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/modules/demux/mkv/demux.cpp b/modules/demux/mkv/demux.cpp
> index ca50504..f06cf7b 100644
> --- a/modules/demux/mkv/demux.cpp
> +++ b/modules/demux/mkv/demux.cpp
> @@ -798,6 +798,7 @@ bool demux_sys_t::PreparePlayback(
> virtual_segment_c & new_vsegment, mtime_t i_m
>      p_current_vsegment->CurrentSegment()->Select( i_mk_date );
> 
>      /* Seek to the beginning */

I'd do it this way.

if (i_pcr != VLC_TS_INVALID)
{
> +    es_out_Control(
> p_current_vsegment->CurrentSegment()->sys.demuxer.out,
> ES_OUT_RESET_PCR);
i_pcr = VLC_TS_INVALID;
}

>      
> p_current_vsegment->Seek(p_current_vsegment->CurrentSegment()->sys.demuxer,
>                               i_mk_date,
> p_current_vsegment->p_current_vchapter, -1);
> 
> @@ -809,6 +810,7 @@ void demux_sys_t::JumpTo( virtual_segment_c &
> vsegment, virtual_chapter_c & vcha
>      if ( !vchapter.p_chapter || !vchapter.p_chapter->Enter( true ) )
>      {
>          // jump to the location in the found segment
> +        es_out_Control( demuxer.out, ES_OUT_RESET_PCR);
>          vsegment.Seek( demuxer, vchapter.i_mk_virtual_start_time,
> &vchapter, -1 );
>      }
>  }

Regards,
-- 
Denis Charmet - TypX
Le mauvais esprit est un art de vivre


More information about the vlc-devel mailing list