mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-11-08 11:13:00 +00:00
Webm muxer fixes and strings.xml changes
* replace "In queue" to "Pending" in the downloads header to avoid confusions (all languages) * use 29bits Clusters size to support huge video resolutions (fixes #2291) (WebmWriter.java) * add missing changes to WebmMuxer.java (i forget select the audio track)
This commit is contained in:
@@ -321,9 +321,8 @@ public class WebMWriter {
|
||||
|
||||
for (int i = 0; i < clusterSizes.size(); i++) {
|
||||
seekTo(out, clusterOffsets.get(i));
|
||||
byte[] size = ByteBuffer.allocate(4).putInt(clusterSizes.get(i) | 0x200000).array();
|
||||
out.write(size, 1, 3);
|
||||
written += 3;
|
||||
byte[] buffer = ByteBuffer.allocate(4).putInt(clusterSizes.get(i) | 0x10000000).array();
|
||||
dump(buffer, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,7 +450,7 @@ public class WebMWriter {
|
||||
/* cluster */
|
||||
dump(new byte[]{0x1f, 0x43, (byte) 0xb6, 0x75}, stream);
|
||||
clusterOffsets.add(written);// warning: max cluster size is 256 MiB
|
||||
dump(new byte[]{0x20, 0x00, 0x00}, stream);
|
||||
dump(new byte[]{0x10, 0x00, 0x00, 0x00}, stream);
|
||||
|
||||
startOffset = written;// size for the this cluster
|
||||
|
||||
|
||||
@@ -22,16 +22,20 @@ class WebMMuxer extends Postprocessing {
|
||||
muxer.parseSources();
|
||||
|
||||
// youtube uses a webm with a fake video track that acts as a "cover image"
|
||||
WebMTrack[] tracks = muxer.getTracksFromSource(1);
|
||||
int audioTrackIndex = 0;
|
||||
for (int i = 0; i < tracks.length; i++) {
|
||||
if (tracks[i].kind == TrackKind.Audio) {
|
||||
audioTrackIndex = i;
|
||||
break;
|
||||
int[] indexes = new int[sources.length];
|
||||
|
||||
for (int i = 0; i < sources.length; i++) {
|
||||
WebMTrack[] tracks = muxer.getTracksFromSource(i);
|
||||
for (int j = 0; j < tracks.length; j++) {
|
||||
if (tracks[j].kind == TrackKind.Audio) {
|
||||
indexes[i] = j;
|
||||
i = sources.length;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
muxer.selectTracks(0, audioTrackIndex);
|
||||
muxer.selectTracks(indexes);
|
||||
muxer.build(out);
|
||||
|
||||
return OK_RESULT;
|
||||
|
||||
Reference in New Issue
Block a user