[vlc-commits] demux:mkv: fix the position displayed for ordered chapters

Steve Lhomme git at videolan.org
Mon Feb 26 10:12:04 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb 23 09:51:51 2018 +0100| [58b32e6c72ecedf414246d40ab03f0c4adc1ddd9] | committer: Hugo Beauzée-Luyssen

demux:mkv: fix the position displayed for ordered chapters

(cherry-picked from commit 70da66682371e9f195cd65cb8c722bac310ec73c)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=58b32e6c72ecedf414246d40ab03f0c4adc1ddd9
---

 modules/demux/mkv/mkv.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index df86a10d8f..72a0ba3dc5 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -332,7 +332,9 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         case DEMUX_GET_POSITION:
             pf = va_arg( args, double * );
             if ( p_sys->f_duration > 0.0 )
-                *pf = static_cast<double> (p_sys->i_pcr >= p_sys->i_start_pts ? p_sys->i_pcr : p_sys->i_start_pts ) / (1000.0 * p_sys->f_duration);
+                *pf = static_cast<double> (p_sys->i_pcr >= (p_sys->i_start_pts + p_sys->i_mk_chapter_time) ?
+                                               p_sys->i_pcr :
+                                               (p_sys->i_start_pts + p_sys->i_mk_chapter_time) ) / (1000.0 * p_sys->f_duration);
             return VLC_SUCCESS;
 
         case DEMUX_SET_POSITION:



More information about the vlc-commits mailing list