[vlc-commits] input:item: return 0 when the duration is unset

Steve Lhomme git at videolan.org
Mon Jul 30 07:16:06 CEST 2018


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Jul 27 12:21:40 2018 +0200| [a91ae9d4f451952df0a6d1ce3006b4b590478356] | committer: Steve Lhomme

input:item: return 0 when the duration is unset

The return value is not checked anywhere and the function is not documented.

In case the value of VLC_TICK_INVALID changes we should not return a bad value.

--
or we need to document the function and check the return value everywhere

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

 src/input/item.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/input/item.c b/src/input/item.c
index 62fee5770c..934d86e4ac 100644
--- a/src/input/item.c
+++ b/src/input/item.c
@@ -405,6 +405,8 @@ vlc_tick_t input_item_GetDuration( input_item_t *p_i )
     vlc_mutex_unlock( &p_i->lock );
     if (i_duration == INPUT_DURATION_INDEFINITE)
         i_duration = 0;
+    else if (i_duration == INPUT_DURATION_UNSET)
+        i_duration = 0;
     return i_duration;
 }
 



More information about the vlc-commits mailing list