[vlc-commits] demux: ogg: fix GET_TIME/POSITION on chained streams gap

Francois Cartegnie git at videolan.org
Wed Jun 14 00:23:55 CEST 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jun 13 17:57:35 2017 +0200| [78d3459ccc969f5cc210a58813558398290ae670] | committer: Francois Cartegnie

demux: ogg: fix GET_TIME/POSITION on chained streams gap

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

 modules/demux/ogg.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 9e0b7cfc31..46181c3197 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -783,9 +783,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
             return VLC_SUCCESS;
 
         case DEMUX_GET_TIME:
-            pi64 = va_arg( args, int64_t * );
-            *pi64 = p_sys->i_pcr;
-            return VLC_SUCCESS;
+            if( p_sys->i_pcr > VLC_TS_INVALID )
+            {
+                pi64 = va_arg( args, int64_t * );
+                *pi64 = p_sys->i_pcr;
+                return VLC_SUCCESS;
+            }
+            break;
 
         case DEMUX_SET_TIME:
             i64 = va_arg( args, int64_t );
@@ -824,7 +828,7 @@ 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->i_length > 0 )
+            if( p_sys->i_length > 0 && p_sys->i_pcr > VLC_TS_INVALID )
             {
                 *pf =  (double) p_sys->i_pcr /
                        (double) ( p_sys->i_length * (mtime_t)1000000 );



More information about the vlc-commits mailing list