[vlc-devel] [v3 5/9] input:item: return 0 when the duration is unknown, rather than -1

Steve Lhomme robux4 at ycbcr.xyz
Thu Jul 26 10:03:58 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 dd54116e93..5c8090b005 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