Include debug logs only in debug builds

This commit is contained in:
Mira 2026-01-03 11:13:56 +01:00
parent 4ce721e959
commit 5934ccd99c

View File

@ -1,5 +1,7 @@
package org.schabi.newpipe.streams;
import static org.schabi.newpipe.MainActivity.DEBUG;
import android.util.Log;
import android.util.Pair;
@ -282,7 +284,9 @@ public class OggFromWebMWriter implements Closeable {
@Nullable
private byte[] makeMetadata() {
Log.d("OggFromWebMWriter", "Downloading media with codec ID " + webmTrack.codecId);
if (DEBUG) {
Log.d("OggFromWebMWriter", "Downloading media with codec ID " + webmTrack.codecId);
}
if ("A_OPUS".equals(webmTrack.codecId)) {
final var metadata = new ArrayList<Pair<String, String>>();
@ -297,10 +301,12 @@ public class OggFromWebMWriter implements Closeable {
.format(DateTimeFormatter.ISO_DATE)));
}
Log.d("OggFromWebMWriter", "Creating metadata header with this data:");
metadata.forEach(p -> {
Log.d("OggFromWebMWriter", p.first + "=" + p.second);
});
if (DEBUG) {
Log.d("OggFromWebMWriter", "Creating metadata header with this data:");
metadata.forEach(p -> {
Log.d("OggFromWebMWriter", p.first + "=" + p.second);
});
}
return makeOpusTagsHeader(metadata);
} else if ("A_VORBIS".equals(webmTrack.codecId)) {