RFR: 8357714: AudioClip.play crash on macOS when loading resource from jar [v2]
Alexander Matveev
almatvee at openjdk.org
Tue Jul 8 20:58:43 UTC 2025
On Tue, 8 Jul 2025 07:26:28 GMT, Johan Vos <jvos at openjdk.org> wrote:
>> After JDK-8287822 (https://bugs.openjdk.org/browse/JDK-8287822), mpeg file content is no longer played via GSTPlatform but via OSXPlatform.
>> We need to correctly handle data in case the source is a file inside a jar, in which case CJavaInputStreamCallbacks is used.
>>
>> The 2 changes I made are:
>> 1. Use ConnectionHolder instead of Locator for CJavaInputStreamCallbacks in case a jar resource is used.
>> 2. In case of random access datasource, use readBlock instead of readNextBlock in AVMediaPlayer
>
> Johan Vos has updated the pull request incrementally with one additional commit since the last revision:
>
> Process reviewer comments
> Add null checks
> Fix errors in position and length calculations
modules/javafx.media/src/main/native/jfxmedia/platform/osx/OSXMediaPlayer.mm line 331:
> 329: CJavaInputStreamCallbacks *callbacks = new (nothrow) CJavaInputStreamCallbacks();
> 330: jobject jConnectionHolder = CLocator::CreateConnectionHolder(env, jLocator);
> 331: if (callbacks == NULL || jConnectionHolder == NULL) {
Extra space after `callbacks == NULL`.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1839#discussion_r2193427264
More information about the openjfx-dev
mailing list