Skip to content

Commit dfec9c9

Browse files
committed
Don't close output 2 seconds ofter pause as this then breaks playback.
1 parent d798727 commit dfec9c9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

android/app/src/main/java/org/lyrion/squeezelite/Library.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ public synchronized void startPlayer(PlayerService service) {
120120
thread = new Thread(() -> start(ipAddress,
121121
mac,
122122
prefs.getString(Prefs.PLAYER_NAME_KEY, Prefs.DEFAULT_PLAYER_NAME),
123+
0,
123124
VOL_SEP==volumeControl ? 0 : 1,
124125
LOG_ERROR));
125126
thread.start();
@@ -257,6 +258,6 @@ public synchronized void outputChanged(int spdif, int dac) {
257258
isInitialPower = false;
258259
}
259260

260-
private native void start(String lms, String mac, String name, int fixedVolume, int logging);
261+
private native void start(String lms, String mac, String name, int idleTimeout, int fixedVolume, int logging);
261262
private native void stop();
262263
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Improved
22

33
• Terminate player when powered off via LMS.
4+
• Don't close output 2 seconds ofter pause as this then breaks playback.

android/src/android.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void send_connection_state_to_app(const char *address) {
120120
}
121121
}
122122

123-
JNIEXPORT void JNICALL Java_org_lyrion_squeezelite_Library_start(JNIEnv *env, jobject jobj, jstring lms_param, jstring mac_param, jstring name_param, jint fixed_vol, jint logging) {
123+
JNIEXPORT void JNICALL Java_org_lyrion_squeezelite_Library_start(JNIEnv *env, jobject jobj, jstring lms_param, jstring mac_param, jstring name_param, jint idle, jint fixed_vol, jint logging) {
124124
const char *server = (*env)->GetStringUTFChars(env, lms_param, NULL);
125125
const char *mac_str = (*env)->GetStringUTFChars(env, mac_param, NULL);
126126
char *output_device = "default";
@@ -136,7 +136,6 @@ JNIEXPORT void JNICALL Java_org_lyrion_squeezelite_Library_start(JNIEnv *env, jo
136136
unsigned rate_delay = 0;
137137
char *resample = NULL;
138138
char *output_params = NULL;
139-
unsigned idle = 2000;
140139
#if DSD
141140
unsigned dsd_delay = 0;
142141
dsd_format dsd_outfmt = PCM;
@@ -190,7 +189,7 @@ JNIEXPORT void JNICALL Java_org_lyrion_squeezelite_Library_start(JNIEnv *env, jo
190189

191190
stream_init(log_stream, stream_buf_size);
192191

193-
output_init_pa(log_output, output_device, output_buf_size, output_params, rates, rate_delay, idle, 0!=fixed_vol);
192+
output_init_pa(log_output, output_device, output_buf_size, output_params, rates, rate_delay, (unsigned int)idle, 0!=fixed_vol);
194193

195194
#if DSD
196195
dsd_init(dsd_outfmt, dsd_delay);

0 commit comments

Comments
 (0)