[vlc-commits] lua vimeo playlist: no need to parse vlc.path more than once

Cheng Sun git at videolan.org
Fri Feb 17 01:02:35 CET 2012


vlc | branch: master | Cheng Sun <chengsun9 at gmail.com> | Wed Feb 15 19:34:05 2012 +0000| [cc56ca3a2afd1c9a1f5f6ed3e42b7f567c2a8bc5] | committer: Jean-Baptiste Kempf

lua vimeo playlist: no need to parse vlc.path more than once

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 share/lua/playlist/vimeo.lua |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/share/lua/playlist/vimeo.lua b/share/lua/playlist/vimeo.lua
index 249002e..bac7b8a 100644
--- a/share/lua/playlist/vimeo.lua
+++ b/share/lua/playlist/vimeo.lua
@@ -51,6 +51,8 @@ function parse()
     if string.match ( vlc.path, "vimeo.com/moogaloop" ) then
         prefres = get_prefres()
         ishd = false
+        -- Try to find id of the video
+        _,_,id = string.find (vlc.path, "vimeo.com/moogaloop/load/clip:(.*)/local/")
         while true do
             -- Try to find the video's title
             line = vlc.readline()
@@ -58,8 +60,6 @@ function parse()
             if string.match( line, "<caption>(.*)</caption>" ) then
                 _,_,name = string.find (line, "<caption>(.*)</caption>" )
             end
-            -- Try to find id of the video
-            _,_,id = string.find (vlc.path, "vimeo.com/moogaloop/load/clip:(.*)/local/")
             -- Try to find image for thumbnail
             if string.match( line, "<thumbnail>(.*)</thumbnail>" ) then
                 _,_,arturl = string.find (line, "<thumbnail>(.*)</thumbnail>" )



More information about the vlc-commits mailing list