Permalink
Browse files

document and clean up DLNA.ORG_OP flags handling

  • Loading branch information...
1 parent 6312a72 commit 047a0d6292dfc5cae1b3c1b0222369c052afb916 @chocolateboy chocolateboy committed Aug 26, 2012
Showing with 32 additions and 12 deletions.
  1. +32 −12 src/main/java/net/pms/dlna/DLNAResource.java
View
44 src/main/java/net/pms/dlna/DLNAResource.java
@@ -1283,34 +1283,54 @@ public final String toString(RendererConfiguration mediaRenderer) {
if (!isFolder()) {
int indexCount = 1;
+
if (mediaRenderer.isDLNALocalizationRequired()) {
indexCount = getDLNALocalesCount();
}
+
for (int c = 0; c < indexCount; c++) {
openTag(sb, "res");
- // DLNA.ORG_OP : 1er 10 = exemple: TimeSeekRange.dlna.org :npt=187.000-
- // 01 = Range par octets
- // 00 = pas de range, meme pas de pause possible
+
+ // DLNA.ORG_OP flags
+ //
+ // Two booleans (binary digits) which determine what transport operations the renderer is allowed to
+ // request (in the form of HTTP headers): the first digit allows the renderer to send
+ // TimeSeekRange.DLNA.ORG (seek-by-time) headers; the second allows it to send RANGE (seek-by-byte)
+ // headers.
+ //
+ // See here for an example of how these options can be mapped to keys on the renderer's controller:
+ // http://www.ps3mediaserver.org/forum/viewtopic.php?f=2&t=2908&p=19051#p12550
+ //
+ // 00 - no seeking (or even pausing) allowed
+ // 01 - seek by byte
+ // 10 - seek by time
+ // 11 - seek by both
+
flags = "DLNA.ORG_OP=01";
- if (getPlayer() != null) {
- if (getPlayer().isTimeSeekable() && mediaRenderer.isSeekByTime()) {
- if (mediaRenderer.isPS3()) { // ps3 doesn't like OP=11
- flags = "DLNA.ORG_OP=10";
- } else {
+
+ if (mediaRenderer.isSeekByTime()) {
+ if (getPlayer() != null) { // transcoded
+ if (getPlayer().isTimeSeekable()) {
+ if (mediaRenderer.isPS3()) { // PS3 doesn't like OP=11
+ flags = "DLNA.ORG_OP=10";
+ } else {
+ flags = "DLNA.ORG_OP=11";
+ }
+ }
+ } else { // streamed
+ if (!mediaRenderer.isPS3()) {
flags = "DLNA.ORG_OP=11";
}
}
- } else {
- if (mediaRenderer.isSeekByTime() && !mediaRenderer.isPS3()) {
- flags = "DLNA.ORG_OP=11";
- }
}
+
addAttribute(sb, "xmlns:dlna", "urn:schemas-dlna-org:metadata-1-0/");
String mime = getRendererMimeType(mimeType(), mediaRenderer);
if (mime == null) {
mime = "video/mpeg";
}
+
if (mediaRenderer.isPS3()) { // XXX TO REMOVE, OR AT LEAST MAKE THIS GENERIC // whole extensions/mime-types mess to rethink anyway
if (mime.equals("video/x-divx")) {
dlnaspec = "DLNA.ORG_PN=AVI";

0 comments on commit 047a0d6

Please sign in to comment.