[vlc-commits] youtube.lua: avoid parsing a nil variable

Pierre Ynard git at videolan.org
Thu Aug 4 20:38:50 CEST 2011


vlc/vlc-1.1 | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Thu Aug  4 20:32:00 2011 +0200| [c77c2f1cacdef05c0c87b452da62e9a4748bd843] | committer: Pierre Ynard

youtube.lua: avoid parsing a nil variable
(cherry picked from commit 90dfae907387cd136de35b1da4feab46d10a1a52)

Signed-off-by: Pierre Ynard <linkfanel at yahoo.fr>

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

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

diff --git a/share/lua/playlist/youtube.lua b/share/lua/playlist/youtube.lua
index 5d386eb..62d8240 100644
--- a/share/lua/playlist/youtube.lua
+++ b/share/lua/playlist/youtube.lua
@@ -88,9 +88,9 @@ function parse()
                 -- vlc.msg.err( t )
                 -- video_id = string.gsub( line, ".*&video_id:'([^']*)'.*", "%1" )
                 fmt_url_map = string.match( line, "\"fmt_url_map\": \"(.-)\"" )
-                -- FIXME: do this properly
-                fmt_url_map = string.gsub( fmt_url_map, "\\u0026", "&" )
                 if fmt_url_map then
+                    -- FIXME: do this properly
+                    fmt_url_map = string.gsub( fmt_url_map, "\\u0026", "&" )
                     for itag,url in string.gmatch( fmt_url_map, "(%d+)|([^,]+)" ) do
                         -- Apparently formats are listed in quality order,
                         -- so we can afford to simply take the first one



More information about the vlc-commits mailing list