Changeset 12462 in josm


Ignore:
Timestamp:
2017-07-10T01:34:48+02:00 (12 days ago)
Author:
Don-vip
Message:

fix #15003 - NPE at JavaFxMediaPlayer.speed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/audio/JavaFxMediaPlayer.java

    r12414 r12462  
    5656
    5757    @Override
    58     public void play(Execute command, State stateChange, URL playingUrl) throws AudioException, IOException {
     58    public synchronized void play(Execute command, State stateChange, URL playingUrl) throws AudioException, IOException {
    5959        try {
    6060            final URL url = command.url();
     
    8686
    8787    @Override
    88     public void pause(Execute command, State stateChange, URL playingUrl) throws AudioException, IOException {
     88    public synchronized void pause(Execute command, State stateChange, URL playingUrl) throws AudioException, IOException {
    8989        if (mediaPlayer != null) {
    9090            try {
     
    103103
    104104    @Override
    105     public double position() {
    106         return mediaPlayer.getCurrentTime().toSeconds();
     105    public synchronized double position() {
     106        return mediaPlayer != null ? mediaPlayer.getCurrentTime().toSeconds() : -1;
    107107    }
    108108
    109109    @Override
    110     public double speed() {
    111         return mediaPlayer.getCurrentRate();
     110    public synchronized double speed() {
     111        return mediaPlayer != null ? mediaPlayer.getCurrentRate() : -1;
    112112    }
    113113
Note: See TracChangeset for help on using the changeset viewer.