New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad hack breaks contentFeatures when transcoding to non-NTSC #1401
Comments
MPEG_PS_PALLocalizedValue but it should be determined if renderer is capable to use it by using ProtocolInfo.
MPEG_PS_PALLocalizedValue but it should be determined if renderer is capable to use it by using ProtocolInfo.
I understand now that this is a feature, not a bug. |
This is still a bug |
@SubJunk What I mean by "feature" in this context is that it's the way the code is written. There's no "bug" to fix here, a complete redesign of everything related to protocolInfo and other DLNA metadata communication is needed to be able to fix it. As I've seen no will to or interest in this for several years there's no other conclusion than that you're happy with the current implementation. The fact that you keep "tweaking" the existing, deeply flawed, implementation also indicates that there's no intent to fix it. |
It's an incorrect assumption that I'm happy with the current implementation; if I had more time I would work on all of these open issues and ideally get us to really nice, thread-safe, standards-compliant code. However, I am a full time single father, and I work full time. Other people don't have the same limitations on time and I am focusing on getting more devs onto this project so our issue backlog can make progress |
This isn't exactly a new situation, it's been like this for years and years, and despite the lack of time I haven't seen that any of the time that is spent on this project is spent on things like that. I don't doubt that everybody wish the implementation was better though, what I question is the will to make it so. In the end, do like you want, if you want open issues that will just stay untouched forever, please go ahead. I simply closed it because I no longer have any plan to try to do this, and my impression this far has been that I've been the only one actually trying to do anything about it. |
Yes you have been the only one so far, but that's not necessarily true of the future, especially since this is the only time since UMS started that I have actively recruited more developers. It would be good to attract another Java-specific developer who can improve thread-safety because I think you were the only one with deep enough knowledge about that. I would need to do a lot of reading in order to feel confident with that, which I am interested in doing if I ever get the time, but that isn't really my job as the project leader. Ideally I see my role in this project continuing to be as a lead/admin who can facilitate other developers rather than doing the big development myself, since that will allow me to use my time more efficiently. I have failed in that role at certain times because I didn't respond to people quickly enough and it resulted in stale code, but I have been on top of that lately and will continue to focus my efforts on making sure that I do everything I can do get code submissions progressed. |
It would be very nice if you found some others that were interested in and able to improve the quality of the code (that's what I call these things in short). Regarding your role, that's never been my "problem". What I have found frustrating is that trying to fix these things have only met opposition or being ignored. From everybody. I concluded back in 2016 that this simply isn't a priority, which is why I made DMS to be able to focus on this without having to constantly "fight" for it or have it crapped all over by new code that just makes things worse committed constantly. You've mentioned several times my "Java knowledge". Just for the record, I don't see myself as being that knowledgeable with Java. I constantly have to do "research" when I try to find the best way to do things, and I had never seen a line of Java in my life when I joined this project. I have picked up some things along the way though, but I don't consider myself anywhere close to the people that are truly knowledgeable about Java. When it comes to thread safety I've never understood why the rest of you haven't been willing to take this into consideration. It's like it's super difficult or something, which isn't true at all. Thread safety is extremely simple as a concept: Don't let a thread write to something in shared memory that theoretically can be either read or written by another thread at the same time. Then one must realize that one can just forget about trying to anticipate whether things will actually happen at the same time. There are so many things that impact that, from low level stuff like CPU scheduling and reordering to things you don't think about of changed use of the code in the future. So, my principle is, don't even think about if it will happen. Simply make sure it can't happen. When it comes to implementing thread safety, it isn't necessarily so easy. I still find Java frustrating in this regard because of the tools it gives us to control this. They have so many quirks and often behave different than what I find intuitive, and this is where the difficulty lies. But, in most cases, it can be handled with one of three strategies:
|
Yes there have been frustrations by all of us for various reasons that we have all talked about for a long time. I wish you luck with DMS, I hope it is a less frustrating experience for you. I have been reading about thread safety lately and I intend to keep it in mind when I am developing for UMS. Thanks for the notes. |
I recently did a lot of work on ORG_PN values and verified it with a user who was having problems, so I believe this to be fixed. Feel free to reopen if it's not. |
Based on this forum thread. Although I can't say for sure that this is the cause for the user's problem, I can say for sure that this is a terrible hack that will break a lot. It simply seems like somebody didn't finish their code and it has stayed this way.
When looking at one of the problematic files, this is the DLNA information given in the DIDL-Lite:
Later when the renderer asks for
contentFeatures
for the same video, this is sent:According to DLNA these are required to be identical. I suspect that CI and FLAGS doesn't cause much havoc though, but the PN definitly will.
The reason is also easy to see:
UniversalMediaServer/src/main/java/net/pms/dlna/DLNAResource.java
Lines 442 to 447 in 5d1a197
localizationValue == 1
simply means NTSC, so NTSC will always be used forcontentFeatures
. Although there's a comment there, that doesn't help. The code is still broken. I don't see any obvious way to know what value to use either, since UMS doesn't track what<res>
element the renderer picks. From what I can see from the very messy code generating the DIDL, one version is offered for each "localization" if the renderer "require localization". That isn't the case for the renderer in question here, so only one is returned. How that ends up being PAL is beyond me, but it's probably due to some other hack. The code seems to me to simply offer NTSC to any renderer that doesn't "require localization".This will fail also if the renderer is set to "require localization" because the renderer will then be offered different versions of the file (or at least with different DLNA profiles while actual compliance to the particular profile is ignored). If the renderer doesn't pick the first (NTSC/NA version), and later requests
contentFeatures
the wrong result will be returned again - since it's hardcoded to 1.I have my hands on too many other things right now so I won't solve this. I think this is a very bad bug, and I urge some of you to fix it. Despite the fact that
contentFeatures
is somewhat "deprecated" by DLNA, it seems that many relatively new renderers request this. It is a mandatory function in any case according to DLNA, and the information is required to be absolutely identical in DIDL-Lite andcontentFeatures
- which means that renderer developers rely on this to be true.For reference, this is the mess of a code that "handles" the "localization":
UniversalMediaServer/src/main/java/net/pms/dlna/DLNAResource.java
Lines 2494 to 2666 in 5d1a197
The text was updated successfully, but these errors were encountered: