Skip to content
Browse files

tsMuxeR: restore/clean up the pre-1.82.0 compatibility logic

  • Loading branch information...
1 parent 7b64473 commit ed803019d1329f952bff84237eb8f4569f4035b0 @chocolateboy chocolateboy committed Jun 4, 2013
View
2 CHANGELOG.txt
@@ -4,6 +4,8 @@ Changelog:
1.83.0 - 2013-??-??
Engines:
+ - tsMuxeR:
+ - regression: restore the pre-1.82.0 compatibility logic
- VLC Web Video:
- Fix NPE
View
8 src/main/java/net/pms/dlna/FileTranscodeVirtualFolder.java
@@ -219,7 +219,7 @@ public void resolve() {
}
// assemble copies for each combination of audio, subtitle and player
- ArrayList<DLNAResource> entries = new ArrayList<DLNAResource>();
+ ArrayList<DLNAResource> copies = new ArrayList<DLNAResource>();
// create copies of the audio/subtitle track lists as we're making (local)
// modifications to them
@@ -288,16 +288,16 @@ are assigned (ignoring the trivial clone operation in ChapterFileTranscodeVirtua
// create a copy for each compatible player
for (Player player : players) {
DLNAResource copy = createResourceWithAudioSubtitlePlayer(child, audio, subtitle, player);
- entries.add(copy);
+ copies.add(copy);
}
}
}
// Sort the list of combinations
- Collections.sort(entries, new ResourceSort(PlayerFactory.getAllPlayers()));
+ Collections.sort(copies, new ResourceSort(PlayerFactory.getAllPlayers()));
// Now add the sorted list of combinations to the folder
- for (DLNAResource dlna : entries) {
+ for (DLNAResource dlna : copies) {
LOGGER.trace(
"Adding {}: audio: {}, subtitle: {}, player: {}",
new Object[] {
View
35 src/main/java/net/pms/encoders/TSMuxerVideo.java
@@ -874,19 +874,38 @@ public boolean isPlayerCompatible(RendererConfiguration mediaRenderer) {
* {@inheritDoc}
*/
@Override
- public boolean isCompatible(DLNAResource resource) {
+ public boolean isCompatible(DLNAResource dlna) {
if (!(
- PlayerUtil.isVideo(resource, Format.Identifier.MKV) ||
- PlayerUtil.isVideo(resource, Format.Identifier.MPG)
+ PlayerUtil.isVideo(dlna, Format.Identifier.MKV) ||
+ PlayerUtil.isVideo(dlna, Format.Identifier.MPG)
)) {
return false;
}
- // subtitles are not supported by tsMuxeR
- DLNAMediaInfo media = resource.getMedia();
- if (media != null) {
- List<DLNAMediaSubtitle> subtitles = media.getSubtitleTracksList();
- if (subtitles.size() > 0) {
+ /*
+ * Notes:
+ *
+ * 1) isCompatible is used for two separate tasks: 1) selection
+ * of #--TRANSCODE--# folder entries (PlayerFactory.getPlayers)
+ * and 2) assignment of the default player for a resource
+ * (PlayerFactory.getPlayer)
+ *
+ * 2) for resources that aren't in the #--TRANSCODE--# folder, it's understood
+ * that tsMuxeR will only stream the first audio track and that it won't/can't
+ * stream subtitles, so no need to check either
+ */
+ if (dlna.isNoName()) { // #--TRANSCODE--# folder entry
+ DLNAMediaAudio dlnaMediaAudio = dlna.getMediaAudio();
+
+ // media is non-null and audioTrackList is non-empty by definition if
+ // mediaAudio has been set (see FileTranscodeVirtualFolder)
+ if ((dlnaMediaAudio != null) && !dlnaMediaAudio.toString().equals(dlna.getMedia().getFirstAudioTrack().toString())) {
+ // PMS only supports playback of the first audio track for tsMuxeR
+ return false;
+ }
+
+ // XXX why is tsMuxeR compatible if the subtitle language is null?
+ if ((dlna.getMediaSubtitle() != null) && (dlna.getMediaSubtitle().getLang() != null)) {
return false;
}
}
View
2 src/main/java/net/pms/encoders/VLCVideo.java
@@ -315,7 +315,7 @@ public ProcessWrapper launchTranscode(String fileName, DLNAResource dlna, DLNAMe
} else { // Load by ID (better)
cmdList.add("--sub-track=" + params.sid.getId());
}
- } else if (!pmsconfig.isDisableSubtitles()){ // Not specified, use language from GUI if enabled
+ } else if (!pmsconfig.isDisableSubtitles()) { // Not specified, use language from GUI if enabled
// FIXME: VLC does not understand "loc" or "und".
cmdList.add("--sub-language=" + pmsconfig.getSubtitlesLanguages());
} else {

0 comments on commit ed80301

Please sign in to comment.
Something went wrong with that request. Please try again.