[vlc-commits] demux:mkv: do not return VLC_EGENERIC on DEMUX_GET_LENGTH when the duration is unknown
Steve Lhomme
git at videolan.org
Mon Mar 19 13:36:03 CET 2018
vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jan 2 16:38:11 2018 +0100| [58101bfa1f9d3216aac89f8a0cc38042764cc306] | committer: Steve Lhomme
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>
(cherry picked from commit e37f42f4a2620dfcc67b902ed3366b52194f3ef1)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=58101bfa1f9d3216aac89f8a0cc38042764cc306
---
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 d9c5f912b8..1667c12a0e 100644
--- a/modules/demux/mkv/mkv.cpp
+++ b/modules/demux/mkv/mkv.cpp
@@ -323,11 +323,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