joshaber / MacShairport

A native Mac Shairport implementation
Other
176 stars 25 forks source link

Volume unresponsive #5

Closed rcarlsen closed 13 years ago

rcarlsen commented 13 years ago

The volume of the host doesn't seem to respond to adjustments when the slider is moved on the playing device. Tail of the console output during a volume change attempt pasted below. In this case, the server and host are the same machine.

2011-05-11 00:18:14.477 ShairPort[56583:903] -[MSShairportServer connection:didReceiveData:] [Line 75] Raw request: SET_PARAMETER rtsp://fe80::e2f8:47ff:fe08:f2aa/3387917879 RTSP/1.0
CSeq: 136
Session: DEADBEEF
Content-Type: text/parameters
Content-Length: 20
User-Agent: iTunes/10.2.2 (Macintosh; Intel Mac OS X 10.6.7) AppleWebKit/533.21.1
Client-Instance: A65BEE5E642352EE
DACP-ID: A65BEE5E642352EE
Active-Remote: 1878106279

volume: -15.515970
2011-05-11 00:18:14.477 ShairPort[56583:903] -[MSShairportServer connection:didReceiveData:] [Line 79] Parsed request: {
    "Active-Remote" = 1878106279;
    Body = "volume: -15.515970
\n";
    CSeq = 136;
    "Client-Instance" = A65BEE5E642352EE;
    "Content-Length" = 20;
    "Content-Type" = "text/parameters";
    "DACP-ID" = A65BEE5E642352EE;
    Method = "SET_PARAMETER rtsp://fe80::e2f8:47ff:fe08:f2aa/3387917879 RTSP/1.0";
    Session = DEADBEEF;
    "User-Agent" = "iTunes/10.2.2 (Macintosh; Intel Mac OS X 10.6.7) AppleWebKit/533.21.1";
}
2011-05-11 00:18:14.478 ShairPort[56583:903] -[MSShairportServer respondToRequest:connection:] [Line 264] Response: RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 136
rcarlsen commented 13 years ago

Found the issue. MSShairportServer.m:394

Have to explicitly ask for the floatValue of the (NSString) object returned in the body dictionary for the volume level. I'll send a pull request shortly.

joshaber commented 13 years ago

Resolved by bd11349b11c1feb3443474f0aae5d5bbf70ea9c0