diff options
author | sfan5 <sfan5@live.de> | 2023-08-06 15:57:32 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-08-08 20:15:20 +0200 |
commit | a949e5836260f7407166265498e066bb846419f4 (patch) | |
tree | 9d764bff980a85be60c4ad0e45694e472394d34c /audio/out/ao_audiotrack.c | |
parent | efebd50a6c009f2eb5aed90f2ab742b584dc7cab (diff) | |
download | mpv-a949e5836260f7407166265498e066bb846419f4.tar.bz2 mpv-a949e5836260f7407166265498e066bb846419f4.tar.xz |
ao_audiotrack: fix broken exception checks
The exception always has to be checked and cleared even if we
can already see that no valid value was returned.
Diffstat (limited to 'audio/out/ao_audiotrack.c')
-rw-r--r-- | audio/out/ao_audiotrack.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/audio/out/ao_audiotrack.c b/audio/out/ao_audiotrack.c index d109384192..b2e0ba6c02 100644 --- a/audio/out/ao_audiotrack.c +++ b/audio/out/ao_audiotrack.c @@ -332,7 +332,7 @@ static int AudioTrack_New(struct ao *ao) p->cfg_session_id ); } - if (!audiotrack || MP_JNI_EXCEPTION_LOG(ao) < 0) { + if (MP_JNI_EXCEPTION_LOG(ao) < 0 || !audiotrack) { MP_FATAL(ao, "AudioTrack Init failed\n"); return -1; } @@ -709,7 +709,7 @@ static int init(struct ao *ao) p->channel_config, p->format ); - if (buffer_size <= 0 || MP_JNI_EXCEPTION_LOG(ao) < 0) { + if (MP_JNI_EXCEPTION_LOG(ao) < 0 || buffer_size <= 0) { MP_FATAL(ao, "AudioTrack.getMinBufferSize returned an invalid size: %d", buffer_size); return -1; } @@ -724,7 +724,7 @@ static int init(struct ao *ao) p->chunk = talloc_size(ao, p->size); jobject timestamp = MP_JNI_NEW(AudioTimestamp.clazz, AudioTimestamp.ctor); - if (!timestamp || MP_JNI_EXCEPTION_LOG(ao) < 0) { + if (MP_JNI_EXCEPTION_LOG(ao) < 0 || !timestamp) { MP_FATAL(ao, "AudioTimestamp could not be created\n"); return -1; } |