Permalink
Browse files

Merge pull request #20 from sodabrew/patch-sdinfo

Handle missing airplay dns-sd info.
  • Loading branch information...
2 parents f3937ab + acfdd56 commit 9e7b70cf753d769b05e547f06b787286738de350 @elcuervo committed Sep 5, 2012
Showing with 16 additions and 16 deletions.
  1. +12 −12 lib/airplay/server/features.rb
  2. +4 −4 lib/airplay/server/node.rb
@@ -13,17 +13,17 @@ class Airplay::Server::Features
:PhotoCaching
def initialize(features)
- @Video = 0 == (features & ( 1 << 0 ))
- @Photo = 0 == (features & ( 1 << 1 ))
- @VideoFairPlay = 0 == (features & ( 1 << 2 ))
- @VideoVolumeControl = 0 == (features & ( 1 << 3 ))
- @VideoHTTPLiveStreams = 0 == (features & ( 1 << 4 ))
- @Slideshow = 0 == (features & ( 1 << 5 ))
- @Screen = 0 == (features & ( 1 << 7 ))
- @ScreenRotate = 0 == (features & ( 1 << 8 ))
- @Audio = 0 == (features & ( 1 << 9 ))
- @AudioRedundant = 0 == (features & ( 1 << 11 ))
- @FPSAPv2pt5_AES_GCM = 0 == (features & ( 1 << 12 ))
- @PhotoCaching = 0 == (features & ( 1 << 13 ))
+ @Video = 0 < (features & ( 1 << 0 ))
+ @Photo = 0 < (features & ( 1 << 1 ))
+ @VideoFairPlay = 0 < (features & ( 1 << 2 ))
+ @VideoVolumeControl = 0 < (features & ( 1 << 3 ))
+ @VideoHTTPLiveStreams = 0 < (features & ( 1 << 4 ))
+ @Slideshow = 0 < (features & ( 1 << 5 ))
+ @Screen = 0 < (features & ( 1 << 7 ))
+ @ScreenRotate = 0 < (features & ( 1 << 8 ))
+ @Audio = 0 < (features & ( 1 << 9 ))
+ @AudioRedundant = 0 < (features & ( 1 << 11 ))
+ @FPSAPv2pt5_AES_GCM = 0 < (features & ( 1 << 12 ))
+ @PhotoCaching = 0 < (features & ( 1 << 13 ))
end
end
@@ -4,9 +4,9 @@ class Airplay::Server::Node
def initialize(name, domain, ip, port, info)
@name, @domain, @ip, @port = name, domain, ip, port
- @features = Airplay::Server::Features.new info.fetch('features', 0).hex
- @deviceid = info.fetch('deviceid')
- @srcvers = info.fetch('srcvers')
- @model = info.fetch('model')
+ @features = Airplay::Server::Features.new info.fetch('features', '0').hex
+ @deviceid = info.fetch('deviceid', nil)
+ @srcvers = info.fetch('srcvers', nil)
+ @model = info.fetch('model', nil)
end
end

0 comments on commit 9e7b70c

Please sign in to comment.