[vlc-commits] demux: ttml: use next_demux_time for position/time

Francois Cartegnie git at videolan.org
Fri Jan 20 21:35:03 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jan 20 17:08:07 2017 +0100| [2febfd1a3638747a4b4ed4c5a93b68cc147f2b93] | committer: Francois Cartegnie

demux: ttml: use next_demux_time for position/time

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2febfd1a3638747a4b4ed4c5a93b68cc147f2b93
---

 modules/demux/ttml.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/modules/demux/ttml.c b/modules/demux/ttml.c
index 38f06bb..954727d 100644
--- a/modules/demux/ttml.c
+++ b/modules/demux/ttml.c
@@ -185,12 +185,7 @@ static int Control( demux_t* p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
         case DEMUX_GET_TIME:
             pi64 = (int64_t*)va_arg( args, int64_t * );
-            if( p_sys->times.i_current < p_sys->times.i_count )
-                *pi64 = p_sys->times.p_array[p_sys->times.i_current];
-            else if( p_sys->times.i_count )
-                *pi64 = p_sys->times.p_array[p_sys->times.i_count - 1];
-            else
-                break;
+            *pi64 = p_sys->i_next_demux_time;
             return VLC_SUCCESS;
         case DEMUX_SET_TIME:
             i64 = (int64_t)va_arg( args, int64_t );
@@ -225,7 +220,7 @@ static int Control( demux_t* p_demux, int i_query, va_list args )
             }
             else if( p_sys->times.i_count > 0 )
             {
-                *pf = (double) p_sys->times.p_array[p_sys->times.i_current] /
+                *pf = (double) p_sys->i_next_demux_time /
                       (p_sys->times.p_array[p_sys->times.i_count - 1] + 0.5);
             }
             else



More information about the vlc-commits mailing list