Permalink
Browse files

MEncoder: clean up embedded subtitle handling

  • Loading branch information...
1 parent 4cd079f commit cae7f745ff59caa548464b54da7077dc7896b4e8 @chocolateboy chocolateboy committed Nov 7, 2012
Showing with 6 additions and 7 deletions.
  1. +6 −7 src/main/java/net/pms/encoders/MEncoderVideo.java
@@ -1657,6 +1657,7 @@ public ProcessWrapper launchTranscode(
if (params.sid.isExternal()) {
if (!params.sid.isExternalFileUtf()) {
String subcp = null;
+
// append -subcp option for non UTF external subtitles
if (isNotBlank(configuration.getMencoderSubCp())) {
// manual setting
@@ -1665,6 +1666,7 @@ public ProcessWrapper launchTranscode(
// autodetect charset (blank mencoder_subcp config option)
subcp = SubtitleUtils.getSubCpOptionForMencoder(params.sid);
}
+
if (isNotBlank(subcp)) {
sb.append("-subcp ").append(subcp).append(" ");
if (configuration.isMencoderSubFribidi()) {
@@ -1746,15 +1748,12 @@ public ProcessWrapper launchTranscode(
* TODO: Move the following block up with the rest of the
* 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("" + 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

0 comments on commit cae7f74

Please sign in to comment.