[vlc-devel] [PATCH 04/11] demux:mkv: do not return VLC_EGENERIC on DEMUX_GET_LENGTH when the duration is unknown

Steve Lhomme robux4 at ycbcr.xyz
Tue Jan 2 16:38:11 CET 2018


The doc says to return 0 (VLC_TS_INVALID)
---
 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 4068c3b0d8..577bd683b2 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 * );
-- 
2.14.2



More information about the vlc-devel mailing list