Skip to content

Commit

Permalink
Merge branch 'master' of github.com:UniversalMediaServer/UniversalMed…
Browse files Browse the repository at this point in the history
…iaServer
  • Loading branch information
SubJunk committed Jul 17, 2013
2 parents c4a8f30 + 71857ca commit 3ec8acf
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions src/main/java/net/pms/encoders/FFMpegVideo.java
Expand Up @@ -155,7 +155,7 @@ public List<String> getVideoFilterOptions(DLNAResource dlna, DLNAMediaInfo media
String subsFile = s.toString();
subsFile = subsFile.replace(",", "\\,");

if (params.sid.isEmbedded()) {
if (params.sid.isEmbedded() || (params.sid.isExternal() && params.sid.getType() == SubtitleType.ASS)) {
subsOption = "ass=" + subsFile;
} else if (params.sid.isExternal() && params.sid.getType() == SubtitleType.SUBRIP) {
subsOption = "subtitles=" + subsFile;
Expand Down Expand Up @@ -1049,7 +1049,7 @@ public File getSubtitles(DLNAResource dlna, DLNAMediaInfo media, OutputParams pa
tempSubs = null;
}
}
} else if (params.sid.isExternal() && params.sid.getType() == SubtitleType.SUBRIP) {
} else if (params.sid.isExternal() && (params.sid.getType() == SubtitleType.SUBRIP || params.sid.getType() == SubtitleType.ASS)) {
tempSubs = params.sid.getExternalFile();
}

Expand Down Expand Up @@ -1089,19 +1089,21 @@ else if (params.sid.isExternal()) { // Convert external subs to ASS format
}
*/

if (tempSubs != null && params.sid.isEmbedded() && params.timeseek > 0) {
try {
tempSubs = SubtitleUtils.applyTimeSeekingToASS(tempSubs, params);
} catch (IOException e) {
LOGGER.debug("Applying timeseeking caused an error: " + e);
tempSubs = null;
}
} else if (params.sid.isExternal() && params.sid.getType() == SubtitleType.SUBRIP) {
try {
tempSubs = SubtitleUtils.applyTimeSeekingToSrt(tempSubs, params);
} catch (IOException e) {
LOGGER.debug("Applying timeseeking caused an error: " + e);
tempSubs = null;
if (tempSubs != null && params.timeseek > 0) {
if (params.sid.isEmbedded() || params.sid.getType() == SubtitleType.ASS) {
try {
tempSubs = SubtitleUtils.applyTimeSeekingToASS(tempSubs, params);
} catch (IOException e) {
LOGGER.debug("Applying timeseeking caused an error: " + e);
tempSubs = null;
}
} else if (params.sid.isExternal() && params.sid.getType() == SubtitleType.SUBRIP) {
try {
tempSubs = SubtitleUtils.applyTimeSeekingToSrt(tempSubs, params);
} catch (IOException e) {
LOGGER.debug("Applying timeseeking caused an error: " + e);
tempSubs = null;
}
}
}

Expand Down

0 comments on commit 3ec8acf

Please sign in to comment.