Skip to content

Commit

Permalink
up 2.3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
vapormusic committed Oct 1, 2022
1 parent fe55f44 commit 04b9129
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-win-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,6 @@ jobs:
uses: marvinpinto/[email protected]
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "v2.3.4"
automatic_release_tag: "v2.3.5"
prerelease: false
files: ./**/*.tar.gz
33 changes: 27 additions & 6 deletions lib/device_airtunes.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,21 @@ function AirTunesDevice(host, audioOut, options, mode = 0, txt = "") {
this.host = host;
this.port = options.port || 5000;
this.key = this.host + ':' + this.port;
this.options = options
this.mode = mode; // Homepods with or without passcode
// if(options.password != null && legacy == true){
// this.mode = 1; // Airport / Shairport legacy passcode mode
// this.mode = 2 // MFi mode
// }
this.forceAlac = options.forceAlac ?? true
// this.skipAutoVolume = options.skipAutoVolume ?? false
this.statusflags = [];
this.alacEncoding = options?.alacEncoding ?? true
this.airplay2 = options?.airplay2 ?? false
this.txt = txt;
this.borkedshp = false;
console.log("yasc",this.txt)
console.log('port', this.port)
let a = this.txt.filter((u) => String(u).startsWith('et='))
if((a[0]?? "").includes('4')){
this.mode = 2;
Expand Down Expand Up @@ -116,7 +119,7 @@ function AirTunesDevice(host, audioOut, options, mode = 0, txt = "") {
console.log("needPin",this.needPin)
console.log("mode-atv",this.mode)
console.log("alacEncoding",this.alacEncoding)

try{
this.rtsp = new RTSP.Client(options.volume || 50, options.password || null, audioOut,
{
mode: this.mode,
Expand All @@ -128,8 +131,8 @@ function AirTunesDevice(host, audioOut, options, mode = 0, txt = "") {
debug: options.debug,
transient: this.transient,
borkedshp: this.borkedshp,
});

});} catch(e){
console.log(e)}
this.audioCallback = null;
this.audioPacketHistory = new BufferWithNames(100);
this.encoder = [];
Expand All @@ -152,7 +155,6 @@ AirTunesDevice.prototype.start = function() {

return;
}

self.doHandshake();
});

Expand All @@ -161,7 +163,23 @@ AirTunesDevice.prototype.start = function() {

AirTunesDevice.prototype.doHandshake = function() {
var self = this;

try{
if (this.rtsp == null){
try{
this.rtsp = new RTSP.Client(this.options.volume || 30, this.options.password || null, this.audioOut,
{
mode: this.mode,
txt: this.txt,
alacEncoding: this.alacEncoding,
needPassword: this.needPassword,
airplay2: this.airplay2,
needPin: this.needPin,
debug: true,
transient: this.transient,
borkedshp: this.borkedshp,
});} catch(e){
console.log(e)}
}
this.rtsp.on('config', function(setup) {
self.audioLatency = setup.audioLatency;
self.requireEncryption = setup.requireEncryption;
Expand Down Expand Up @@ -194,7 +212,10 @@ AirTunesDevice.prototype.doHandshake = function() {
if(err !== 'stopped')
self.emit(err);
});

} catch(e){
console.log(e)
}
// console.log(this.udpServers, this.host,this.port)
this.rtsp.startHandshake(this.udpServers, this.host, this.port);
};

Expand Down
3 changes: 3 additions & 0 deletions lib/rtsp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1100,9 +1100,12 @@ Client.prototype.sendNextRequest = async function(di) {
break;

case TEARDOWN:
try{
this.socket.end(this.makeHead('TEARDOWN', '', di) + '\r\n');
} catch(_){}
if (this.debug) console.log('teardown');
this.cleanup('stopped');

// return here since the socket is closed
return;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"audio",
"cider"
],
"version": "2.3.4",
"version": "2.3.5",
"author": "vapormusic <[email protected]>",
"main": "./lib/index.js",
"bin": "./examples/play_ffmpeg.js",
Expand Down

0 comments on commit 04b9129

Please sign in to comment.