[vlc-devel] [PATCH 10/11] input: return 0 when the duration is unknown, rather than -1

Steve Lhomme robux4 at ycbcr.xyz
Tue Jul 24 15:52:30 CEST 2018


The return value is not checked anywhere and the function is not documented.
---
 src/input/item.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/input/item.c b/src/input/item.c
index ca08af6bb5..c5041e00cb 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -403,6 +403,8 @@ vlc_tick_t input_item_GetDuration( input_item_t *p_i )
     vlc_tick_t i_duration = p_i->i_duration;
 
     vlc_mutex_unlock( &p_i->lock );
+    if (i_duration == INPUT_DURATION_UNKNOWN)
+        i_duration = 0;
     return i_duration;
 }
 
-- 
2.17.0



More information about the vlc-devel mailing list