[vlc-commits] DShow: correct elapsed time

Salah-Eddin Shaban git at videolan.org
Mon Feb 13 09:29:01 CET 2017


vlc | branch: master | Salah-Eddin Shaban <salah at videolan.org> | Sun Feb 12 19:29:45 2017 +0200| [0ea273e02fb828e2209f4db002ba498bb73bd041] | committer: Jean-Baptiste Kempf

DShow: correct elapsed time

Close #16977

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/access/dshow/access.h  | 1 +
 modules/access/dshow/dshow.cpp | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/access/dshow/access.h b/modules/access/dshow/access.h
index 97288cb..c748f49 100644
--- a/modules/access/dshow/access.h
+++ b/modules/access/dshow/access.h
@@ -76,5 +76,6 @@ struct access_sys_t
     int            i_height;
     int            i_chroma;
     bool           b_chroma; /* Force a specific chroma on the dshow input */
+    mtime_t        i_start;
 };
 
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index f5c60ef..c084ad4 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -754,6 +754,7 @@ static int DemuxOpen( vlc_object_t *p_this )
         p_stream->p_es = es_out_Add( p_demux->out, &fmt );
     }
 
+    p_sys->i_start = mdate();
     return VLC_SUCCESS;
 }
 
@@ -1932,6 +1933,8 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
     bool    *pb;
     int64_t *pi64;
 
+    access_sys_t *p_sys = ( access_sys_t * ) p_demux->p_sys;
+
     switch( i_query )
     {
     /* Special for access_demux */
@@ -1951,7 +1954,7 @@ static int DemuxControl( demux_t *p_demux, int i_query, va_list args )
 
     case DEMUX_GET_TIME:
         pi64 = (int64_t*)va_arg( args, int64_t * );
-        *pi64 = mdate();
+        *pi64 = mdate() - p_sys->i_start;
         return VLC_SUCCESS;
 
     /* TODO implement others */



More information about the vlc-commits mailing list