[vlc-commits] httprequests.lua: use proper binding to get current stream length
Pierre Ynard
git at videolan.org
Fri Dec 2 17:12:17 CET 2016
vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Fri Dec 2 17:11:42 2016 +0100| [26e83d54b6a9f71073271f7a74f0d21ff2cd8668] | committer: Pierre Ynard
httprequests.lua: use proper binding to get current stream length
... instead of the "length" object variable.
Ref #17285
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=26e83d54b6a9f71073271f7a74f0d21ff2cd8668
---
share/lua/intf/modules/httprequests.lua | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/share/lua/intf/modules/httprequests.lua b/share/lua/intf/modules/httprequests.lua
index e060cc1..094bf3b 100644
--- a/share/lua/intf/modules/httprequests.lua
+++ b/share/lua/intf/modules/httprequests.lua
@@ -456,7 +456,6 @@ getstatus = function (includecategories)
s.volume=vlc.volume.get()
if input then
- s.length=math.floor(vlc.var.get(input,"length") / 1000000)
s.time=math.floor(vlc.var.get(input,"time") / 1000000)
s.position=vlc.var.get(input,"position")
s.currentplid=vlc.playlist.current()
@@ -464,7 +463,6 @@ getstatus = function (includecategories)
s.rate=vlc.var.get(input,"rate")
s.subtitledelay=vlc.var.get(input,"spu-delay") / 1000000
else
- s.length=0
s.time=0
s.position=0
s.currentplid=-1
@@ -473,6 +471,12 @@ getstatus = function (includecategories)
s.subtitledelay=0
end
+ if item then
+ s.length=math.floor(item:duration())
+ else
+ s.length=0
+ end
+
if vout then
s.fullscreen=vlc.var.get(vout,"fullscreen")
s.aspectratio=vlc.var.get(vout,"aspect-ratio");
More information about the vlc-commits
mailing list