Fixes subtitle mapping for video with only external subtitles
All checks were successful
KnarCraft/FFmpegConvert/pipeline/head This commit looks good

This commit is contained in:
2023-08-12 22:14:46 +02:00
parent 5d94cabca0
commit 56f5e31934
3 changed files with 45 additions and 16 deletions

View File

@ -9,19 +9,21 @@ public class SubtitleStream extends AbstractStream implements StreamObject {
final private String file;
final private boolean isFullSubtitle;
final private boolean isImageSubtitle;
final private boolean isInternalStream;
/**
* Instantiates a new subtitle stream
*
* @param codecName <p>The name of the codec for the subtitle stream.</p>
* @param absoluteIndex <p>The index of the subtitle stream.</p>
* @param relativeIndex <p>The index of the subtitle stream relative to other subtitle streams.</p>
* @param language <p>The language of the subtitle stream.</p>
* @param title <p>The title of the subtitle stream.</p>
* @param file <p>The file containing the subtitle.</p>
* @param codecName <p>The name of the codec for the subtitle stream.</p>
* @param absoluteIndex <p>The index of the subtitle stream.</p>
* @param relativeIndex <p>The index of the subtitle stream relative to other subtitle streams.</p>
* @param language <p>The language of the subtitle stream.</p>
* @param title <p>The title of the subtitle stream.</p>
* @param file <p>The file containing the subtitle.</p>
* @param isInternalStream <p>Whether this subtitle stream is in the video file itself</p>
*/
public SubtitleStream(String codecName, int absoluteIndex, int relativeIndex, String language, String title,
String file) {
String file, boolean isInternalStream) {
this.codecName = codecName;
this.absoluteIndex = absoluteIndex;
this.language = language;
@ -29,6 +31,7 @@ public class SubtitleStream extends AbstractStream implements StreamObject {
this.isFullSubtitle = isFullSubtitle();
this.relativeIndex = relativeIndex;
this.isImageSubtitle = isImageSubtitle();
this.isInternalStream = isInternalStream;
this.file = file;
}
@ -50,6 +53,15 @@ public class SubtitleStream extends AbstractStream implements StreamObject {
return this.file;
}
/**
* Gets whether this subtitle stream is an internal stream, not an external one
*
* @return <p>True if this stream is an internal stream</p>
*/
public boolean isInternalSubtitle() {
return this.isInternalStream;
}
/**
* Gets whether the subtitle is an image subtitle
*