Patch below will allow defining MEncoder Custom Options at renderer level so if somebody need interlacing, upscaler or adding black bars for fixing AR problems for specific renderer but not other, it is now possible
When "CustomMencoderOptions" is added to renderer.conf then it will have precedence(global settings will be ignored)
Example from TV.conf to fix Aspect Ratio problems(adding black bars when AR is not 16:9):
- Code: Select all
CustomMencoderOptions=-vf softskip,expand=::::1:16\/9:2
And now the code itself (built on r410):
- Code: Select all
Index: net/pms/configuration/RendererConfiguration.java
===================================================================
--- net/pms/configuration/RendererConfiguration.java (revision 410)
+++ net/pms/configuration/RendererConfiguration.java (working copy)
@@ -303,6 +303,27 @@
return getBoolean(SHOW_DVD_TITLE_DURATION, false);
}
+ private static final String CUSTOM_MENCODER_OPTIONS="CustomMencoderOptions";
+
+ public String getCustomMencoderOptions() {
+ return getString(CUSTOM_MENCODER_OPTIONS, null);
+ }
+
private RendererConfiguration() throws ConfigurationException {
this(null);
}
Index: net/pms/encoders/MEncoderVideo.java
===================================================================
--- net/pms/encoders/MEncoderVideo.java (revision 410)
+++ net/pms/encoders/MEncoderVideo.java (working copy)
@@ -1080,9 +1080,11 @@
}
String add = ""; //$NON-NLS-1$
- if (configuration.getMencoderDecode() == null || configuration.getMencoderDecode().indexOf("-lavdopts") == -1) { //$NON-NLS-1$
+ if (params.mediaRenderer.getCustomMencoderOptions() != null) {
+ if (params.mediaRenderer.getCustomMencoderOptions().indexOf("-lavdopts") == -1) //$NON-NLS-1$
+ add = " -lavdopts debug=0"; //$NON-NLS-1$
+ } else if (configuration.getMencoderDecode() == null || configuration.getMencoderDecode().indexOf("-lavdopts") == -1) //$NON-NLS-1$
add = " -lavdopts debug=0"; //$NON-NLS-1$
- }
String alternativeCodec = "";//"-ac ffac3,ffdca, "; //$NON-NLS-1$
if (dvd)
@@ -1093,7 +1095,7 @@
channels = wmv?2:CodecUtil.getRealChannelCount(configuration, params.aid);
PMS.debug("channels=" + channels);
- StringTokenizer st = new StringTokenizer(alternativeCodec + "-channels " + channels + " " + configuration.getMencoderDecode() + add, " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ StringTokenizer st = new StringTokenizer(alternativeCodec + "-channels " + channels + " " + ((params.mediaRenderer.getCustomMencoderOptions()!=null)?(params.mediaRenderer.getCustomMencoderOptions()):configuration.getMencoderDecode()) + add, " "); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
overridenMainArgs = new String [st.countTokens()];
int i = 0;
boolean next = false;
