mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-02 17:29:31 +02:00
Compare commits
4 commits
e2026dc378
...
3a2d427a46
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3a2d427a46 | ||
![]() |
c25f83da6c | ||
![]() |
980e8f3951 | ||
![]() |
4e9a480fdd |
2 changed files with 12 additions and 7 deletions
|
@ -103,12 +103,12 @@ public final class NewPipeSettings {
|
|||
}
|
||||
|
||||
public static boolean useStorageAccessFramework(final Context context) {
|
||||
// There's a FireOS bug which prevents SAF open/close dialogs from being confirmed with a
|
||||
// remote (see #6455).
|
||||
if (DeviceUtils.isFireTv()) {
|
||||
return false;
|
||||
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
return true;
|
||||
} else if (DeviceUtils.isFireTv()) {
|
||||
// There's a FireOS bug which prevents SAF open/close dialogs from being confirmed with
|
||||
// a remote (see #6455).
|
||||
return false;
|
||||
}
|
||||
|
||||
final String key = context.getString(R.string.storage_use_saf);
|
||||
|
|
|
@ -24,7 +24,11 @@ public class SrtFromTtmlWriter {
|
|||
private final boolean ignoreEmptyFrames;
|
||||
private final Charset charset = StandardCharsets.UTF_8;
|
||||
|
||||
private int frameIndex = 0;
|
||||
// According to the SubRip (.srt) specification, subtitle
|
||||
// numbering must start from 1.
|
||||
// Some players accept 0 or even negative indices,
|
||||
// but to ensure compliance we start at 1.
|
||||
private int frameIndex = 1;
|
||||
|
||||
public SrtFromTtmlWriter(final SharpStream out, final boolean ignoreEmptyFrames) {
|
||||
this.out = out;
|
||||
|
@ -39,7 +43,8 @@ public class SrtFromTtmlWriter {
|
|||
|
||||
private void writeFrame(final String begin, final String end, final StringBuilder text)
|
||||
throws IOException {
|
||||
writeString(String.valueOf(frameIndex++));
|
||||
writeString(String.valueOf(frameIndex));
|
||||
frameIndex += 1;
|
||||
writeString(NEW_LINE);
|
||||
writeString(begin);
|
||||
writeString(" --> ");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue