[vlc-commits] input:item: return 0 when the duration is indefinite, rather than -1

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Jul 24 15:36:46 2018 +0200| [6d88b6f0ccf078754e83437dbad50bbefe81376c] | committer: Steve Lhomme

input:item: return 0 when the duration is indefinite, rather than -1

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

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

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

diff --git a/src/input/item.c b/src/input/item.c
index 6578a57bdf..62fee5770c 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_INDEFINITE)
+        i_duration = 0;
     return i_duration;
 }
 



More information about the vlc-commits mailing list