Skip to content
This repository has been archived by the owner on Feb 9, 2018. It is now read-only.

Commit

Permalink
MEncoder: clean up embedded subtitle handling
Browse files Browse the repository at this point in the history
  • Loading branch information
chocolateboy committed Nov 18, 2012
1 parent 4cd079f commit cae7f74
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/net/pms/encoders/MEncoderVideo.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1657,6 +1657,7 @@ public ProcessWrapper launchTranscode(
if (params.sid.isExternal()) { if (params.sid.isExternal()) {
if (!params.sid.isExternalFileUtf()) { if (!params.sid.isExternalFileUtf()) {
String subcp = null; String subcp = null;

// append -subcp option for non UTF external subtitles // append -subcp option for non UTF external subtitles
if (isNotBlank(configuration.getMencoderSubCp())) { if (isNotBlank(configuration.getMencoderSubCp())) {
// manual setting // manual setting
Expand All @@ -1665,6 +1666,7 @@ public ProcessWrapper launchTranscode(
// autodetect charset (blank mencoder_subcp config option) // autodetect charset (blank mencoder_subcp config option)
subcp = SubtitleUtils.getSubCpOptionForMencoder(params.sid); subcp = SubtitleUtils.getSubCpOptionForMencoder(params.sid);
} }

if (isNotBlank(subcp)) { if (isNotBlank(subcp)) {
sb.append("-subcp ").append(subcp).append(" "); sb.append("-subcp ").append(subcp).append(" ");
if (configuration.isMencoderSubFribidi()) { if (configuration.isMencoderSubFribidi()) {
Expand Down Expand Up @@ -1746,15 +1748,12 @@ public ProcessWrapper launchTranscode(
* TODO: Move the following block up with the rest of the * TODO: Move the following block up with the rest of the
* subtitle stuff * subtitle stuff
*/ */
if (isBlank(externalSubtitlesFileName) && params.sid != null) {
// handle internal subtitles
// note: embedded and internal are mutually exclusive
if (!configuration.isMencoderDisableSubs() && (params.sid != null) && params.sid.isEmbedded()) {
cmdList.add("-sid"); cmdList.add("-sid");
cmdList.add("" + params.sid.getId()); cmdList.add("" + params.sid.getId());
} else if (isNotBlank(externalSubtitlesFileName) && !avisynth()) { // Trick necessary for MEncoder to skip the internal embedded track ?
cmdList.add("-sid");
cmdList.add("100");
} else if (isBlank(externalSubtitlesFileName)) { // Trick necessary for MEncoder to not display the internal embedded track
cmdList.add("-subdelay");
cmdList.add("20000");
} }


// -ofps // -ofps
Expand Down

0 comments on commit cae7f74

Please sign in to comment.