From SF Patch #90:
My LG TV (42LE5500) retrieves items from BrowseDirectChildren in a weird way.
The TV can only display up to 20 items per page, but it sets RequestedCount to
54. StartingIndex is correctly set to 0, 20, 40, ... etc. When minidlna responds
with the 54 entries, the TV sorts folders (containers) first, before items, then
displays the entries, limited to 20 per page.
In my setup, I have ~23 folders whose names are similar to the files, so that
when sorting by name, the folders are mixed with the files, thereby resulting in
duplicate folders appearing on all 3 pages and many missing files. The solution
is to make sure minidlna orders items the same way that the TV expects them, so
that when the StartingIndex is 20 or more, we return the "correct" subset of
items.
Thanks SF user Darell Tan for the fix.
The browsing issue that was reported on Samsung Series F was
actually only present when a custom root container was being
specified (http://sourceforge.net/p/minidlna/patches/121/).
So instead of disabling DCM10, fix our X_GetFeatureList
response when a custom root container is set. If the custom
root is Browse Folders, then drop the user straight to
folder browsing for that media type. If it's something
other than folder browsing, just set all media type roots to
the custom root container.
For future reference, the DCM10 flag enables (at least)
video bookmark support and Samsung "BasicView" support; so
selecting, for example, Videos from the Samsung UI can send
you straight to the Videos section of the media library.
Some images don't include an embedded thumbnail, and others
have the thumbnail in the wrong aspect ratio. In these
cases we resize ourselves, which we should allow to occur
regardless of the NO_RESIZE flag.
Embedded thumbnails may have an undesirable orientation, so
we should do our own scaling with inline rotation if the
thumbnail image needs to be rotated.
Asus O!Play reboots with titles longer than 23 characters with some
file types when there are subtitles present. So we truncate video
file titles with external subtitles.
It also supports subtitles in LG fashion, so add that too.
Pretend that we don't support SamsungGetFeatureList if we have a
custom root container specified, or else the Samsung client will
jump straight to our normal A/V/P sections.
A Samsung TV cannot be reliably detected by checking for "SEC_HHP_TV"
User Agent. Only the first part can be guaranteed, eg. "SEC_HHP_" as the rest
can be changed by the end user.
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
While playback on an Samsung E Series TV is ok, other clients such as VLC
and vplayer (android) attempt to play the artwork rather than the movie.
The issue was traced to minidlna serving the artwork res before the movie res.
Other dlna server's were observed and found to the send the movie first then
the artwork.
Swapping the order seems to keep all tested clients happy.
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>