Skip to content

Commit 62048fe

Browse files
committed
fix audio busy function + get_pos that give invalid number when the player is closed.
1 parent 9b8fad7 commit 62048fe

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

recipes/android/src/android/_android_sound.pyx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,9 @@ def playing_name(channel):
5656
android_sound_playing_name(channel, buf, 1024)
5757

5858
rv = buf
59-
if not rv:
59+
if not len(rv):
6060
return None
61-
else:
62-
return rv
61+
return rv
6362

6463
def pause(channel):
6564
android_sound_pause(channel)

src/src/org/renpy/android/RenPySound.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ synchronized void unpause() {
188188
}
189189

190190
synchronized int get_pos(){
191-
return player[0].getCurrentPosition();
191+
if (prepared[0]) {
192+
return player[0].getCurrentPosition();
193+
}
194+
return 0;
192195
}
193196

194197
synchronized int get_length(){

0 commit comments

Comments
 (0)