Skip to content

Commit

Permalink
Fix usage of array pointer in native callback
Browse files Browse the repository at this point in the history
  • Loading branch information
caprica committed Jan 25, 2025
1 parent ece2120 commit 994bf8a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,12 @@ private final class SetupCallback implements libvlc_video_format_cb {

@Override
public int format(PointerByReference opaque, PointerByReference chroma, Pointer width, Pointer height, PointerByReference pitches, PointerByReference lines) {
int sourceWidth = width.getInt(0);
int sourceHeight = height.getInt(0);
int displayWidth = width.getInt(1);
int displayHeight = height.getInt(1);
int[] widthArray = width.getIntArray(0, 2);
int[] heightArray = height.getIntArray(0, 2);
int sourceWidth = widthArray[0];
int sourceHeight = heightArray[0];
int displayWidth = widthArray[1];
int displayHeight = heightArray[1];
bufferFormat = bufferFormatCallback.getBufferFormat(sourceWidth, sourceHeight);
applyBufferFormat(bufferFormat, chroma, width, height, pitches, lines);
int result = nativeBuffers.allocate(bufferFormat);
Expand Down

0 comments on commit 994bf8a

Please sign in to comment.