OK Shagrath, you are forcing me to learn JAVA!
Here is dirty patch for
forced subtitles:
- Code: Select all
Index: net/pms/encoders/Player.java
===================================================================
--- net/pms/encoders/Player.java (revision 367)
+++ net/pms/encoders/Player.java (working copy)
@@ -155,7 +155,7 @@
if (matchedSub != null && params.sid == null) {
if (matchedSub.lang != null && matchedSub.lang.equals("off")) {
PMS.debug(" Disabled the subtitles: " + matchedSub);
- return;
+ //return;
} else
params.sid = matchedSub;
}
@@ -170,14 +170,30 @@
if (configuration.getUseSubtitles()) {
// priority to external subtitles
for(DLNAMediaSubtitle sub:media.subtitlesCodes) {
- PMS.debug("Found subtitles track : " + sub);
- if (sub.file != null) {
- PMS.debug("Found external file : " + sub.file.getAbsolutePath());
- params.sid = sub;
- break;
+ if (matchedSub.lang !=null && matchedSub.lang.equals("off")) {
+ if (sub.flavor != null && sub.flavor.equalsIgnoreCase("forced")) {
+ if (Iso639.isCodesMatching(sub.lang,configuration.getMencoderSubLanguages())) {
+ PMS.debug("Forcing prefered subtitles : " + sub.getLang() + "/" + sub.flavor);
+ PMS.debug("Forced subtitles track : " + sub);
+ if (sub.file != null) {
+ PMS.debug("Found external forced file : " + sub.file.getAbsolutePath());
+ }
+ params.sid = sub;
+ break;
+ }
+ }
+ continue;
+ } else {
+ PMS.debug("Found subtitles track : " + sub);
+ if (sub.file != null) {
+ PMS.debug("Found external file : " + sub.file.getAbsolutePath());
+ params.sid = sub;
+ break;
+ }
}
- }
+ }
}
+ if (matchedSub.lang !=null && matchedSub.lang.equals("off")) return;
//
if (params.sid == null) {
How it works?When
Autoload subtitles with the same file name is ENABLED and
forced subtitles exist, PMS will load them automatically.
Due to possibility of more
forced subtitles in different languages I used
Subtitle language priority value for defining which
forced subs can be loaded.
This value can be set to only one preferred "forced" subs(no "," possible)!An Example how to configure it(my settings):- Code: Select all
Audio language priority: cs,en,de
- Code: Select all
Subtitles language priority: cs
- Code: Select all
Audio/subtitles language priority: cs,off;sk,off;en,cs;en,sk;und,off;*,cs;*,sk;en,en;*,en;de,de;*,de;*,off
This settings will try to load
forced subs in czech when czech audio exists and if not it will disable subs = cs,off
To make it work you need this naming conventions for tagging subs as
forced ones:
- Code: Select all
moviename.cs-forced.srt
Loading preferred subs you can achieve by choosing
moviename [MEncoder] {External Subtitles} outside #TRANSCODE# folder or by choosing
moviename [MEncoder] {External Subtitles} or
[MEncoder] file in #TRANSCODE# folder.
When
Autoload subtitles with the same file name is DISABLED, PMS doesn't try to find
forced subs!!!
BR
ExSport