Author: titmuss
Date: Wed Oct 22 01:49:52 2008
New Revision: 3180

URL: http://svn.slimdevices.com?rev=3180&root=Jive&view=rev
Log:
Bug: N/A
Description:
Fix initialization order for playback, sometimes a player could be created 
before the uuid and mac address had been set.


Modified:
    
7.3/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua
    7.3/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua

Modified: 
7.3/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua?rev=3180&root=Jive&r1=3179&r2=3180&view=diff
==============================================================================
--- 
7.3/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua 
(original)
+++ 
7.3/trunk/squeezeplay/src/squeezeplay/share/applets/Playback/PlaybackMeta.lua 
Wed Oct 22 01:49:52 2008
@@ -1,5 +1,5 @@
 
-local getmetatable = getmetatable
+local assert, getmetatable = assert, getmetatable
 
 local oo            = require("loop.simple")
 
@@ -41,25 +41,25 @@
        -- this allows us to share state with the applet
        meta.state = {}
 
-       local settings = meta:getSettings()
-
-       if settings.enableAudio & 1 == 1 then
-               -- Create player instance
-               local uuid, mac = jnt:getUUID()
-               meta.state.player = LocalPlayer(jnt, mac, uuid)
-       end
-
        jiveMain:addItem(meta:menuItem('audioPlayback', 'advancedSettings', 
"AUDIO_PLAYBACK", function(applet, ...) applet:settingsShow(meta.state) end, 1))
 end
 
 
 function configureApplet(meta)
-       if not meta.state.player then
+       local settings = meta:getSettings()
+
+       if settings.enableAudio & 1 == 0 then
                -- no audio playback
                return
        end
 
-       local settings = meta:getSettings()
+
+       -- Create player instance
+       local uuid, id = jnt:getUUID()
+       assert(uuid)
+       assert(id)
+
+       meta.state.player = LocalPlayer(jnt, id, uuid)
 
        -- Connect player
        local server = nil
@@ -68,6 +68,7 @@
                server:updateInit(settings.serverInit)
        end
 
+       -- Init player
        if settings.playerInit then
                meta.state.player:updateInit(server, settings.playerInit)
        end

Modified: 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua
URL: 
http://svn.slimdevices.com/7.3/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua?rev=3180&root=Jive&r1=3179&r2=3180&view=diff
==============================================================================
--- 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua 
(original)
+++ 7.3/trunk/squeezeplay/src/squeezeplay/share/jive/slim/LocalPlayer.lua Wed 
Oct 22 01:49:52 2008
@@ -44,8 +44,6 @@
                uuid = uuid,
        })
        obj.playback = Playback(jnt, obj.slimproto)
-
-log:warn("******** ", DEVICE_MODEL, " ", deviceid, " ", obj.slimproto)
 
        -- initialize with default values
        obj:updateInit(nil, {

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to