Skip to content

Commit

Permalink
set the slave before anything
Browse files Browse the repository at this point in the history
  • Loading branch information
SrRapero720 committed Oct 26, 2024
1 parent 5b90376 commit f130338
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public void start(URI url, String[] vlcArgs) {
ThreadTool.thread(4, () -> {
if (rpa(url)) {
if (audioUrl != null) {
raw.mediaPlayer().media().prepare(this.url, vlcArgs);
raw.mediaPlayer().media().slaves().add(MediaSlaveType.AUDIO, MediaSlavePriority.HIGHEST, audioUrl.toString());
raw.mediaPlayer().media().prepare(this.url, vlcArgs);
raw.mediaPlayer().controls().start();
} else {
raw.mediaPlayer().media().start(this.url, vlcArgs);
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/watermedia/core/tools/DataTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ public class DataTool {
private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8;
private static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();

public static String[] concat(String[] arr, String[] arr2) {
String[] r = new String[arr.length + arr2.length];
for (int i = 0; i < (arr.length + arr2.length); i++) {
r[i] = i < arr.length ? arr[i] : arr2[i - arr.length];
}
return r;
}

public static long sumArr(long[] arr) {
long r = 0;
for (long l: arr) {
Expand Down

0 comments on commit f130338

Please sign in to comment.