[vlc-commits] demux:mkv: do not return VLC_EGENERIC on DEMUX_GET_LENGTH when the duration is unknown

Steve Lhomme git at videolan.org
Wed Jan 3 11:17:44 CET 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan  2 16:38:11 2018 +0100| [e37f42f4a2620dfcc67b902ed3366b52194f3ef1] | committer: Jean-Baptiste Kempf

demux:mkv: do not return VLC_EGENERIC on DEMUX_GET_LENGTH when the duration is unknown

The doc says to return 0 (VLC_TS_INVALID)

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

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

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

diff --git a/modules/demux/mkv/mkv.cpp b/modules/demux/mkv/mkv.cpp
index a8019f399c..b813e99ece 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -340,11 +340,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
         case DEMUX_GET_LENGTH:
             pi64 = va_arg( args, int64_t * );
             if( p_sys->f_duration > 0.0 )
-            {
                 *pi64 = static_cast<int64_t>( p_sys->f_duration * 1000 );
-                return VLC_SUCCESS;
-            }
-            return VLC_EGENERIC;
+            else
+                *pi64 = VLC_TS_INVALID;
+            return VLC_SUCCESS;
 
         case DEMUX_GET_POSITION:
             pf = va_arg( args, double * );



More information about the vlc-commits mailing list