Fix several issues with the non-destructive rescan functionality.
Most of these issues also affected inotify scanning as well. These
include annoying debug messages, adding album art for files that we
aren't supposed to be scanning anyway, incrementing the UpdateID when no
changes were made to the database, and other smaller issues.
Some Samsung clients (at least UE40ES8000) apparently cannot handle our
standard container IDs when we turn on the DCM10 feature. So they end up
requesting an empty ObjectID, which is invalid. If we blindly return our
root container, they still have problems browsing because they only use
one object from our returned results, so they don't get a full list of
browseable categories.
It has been confirmed that we can work around this by using the same
ObjectIDs that Samsung uses for our root containers in our
X_GetFeatureList response (A, V, and I). And fortunately it's trivial to
handle these renamed ObjectIDs using our magic container system.
Fixes: SF Bug #311 (Samsung TV built-in DLNA client broken since v1.1.5)
Protect against DoS by limiting the number of subscribers we allow to a
total of 500, and immediately removing subscribers from our list if we
encounter an error communicating with them.
Bolt (Series6) seems to have a bug where it only reacts to
_tivo-videostream._tcp service types after a TiVo reboot, and ignores
_tivo-vidoes._tcp. I have no idea what the difference is supposed to be
because it's undocumented, but either type works on both Roamio (Series5)
and Bolt, so hopefully it's safe for Series 3 and 4 also.
On Darwin & *BSD binding to mcast address may force NITIFY packet send from
this mcast address, not from primary interface address. Therefore subsequent
NOTIFY packets might be ignored by some clients, including Samsung Smart TV
and they will stop & disconnect after initial max-age timeout.
SO_BROADCAST on notify packets is not needed, because there's no broadcasted
M-SEARCH packets and notify socket queue is never read.
Add support for upnp:playbackCount and upnp:lastPlaybackPosition tags.
These are used by Kodi to keep track of bookmark information as well as
determining whether to show the checkmark to indicate that the video
has been played.
Also add support for the UpdateObject command, which Kodi uses to
update the playbackCount and lastPlaybackPosition information.
This change requires a DB schema update, which should be done
automatically on the first run.
Inspired by SF user Karsten's patch #167.
On Hyundai HLN 24TS382 Smart TV, the DLNA client refuses to display
media files whose title does not end with a media file extension.
Because minidlna strips the extensions, all folders thus appear empty.
This patch adds a quirk for Hyundai TVs that appends the original file
extension to the titles, which fixes the issue.
From SF user Andrea Odetti:
The Samsung BD J5500 player does not accept some of the DLNA_PN values
used by minidlna for *.mp4 files.
For instance AVC_MP4_MP_HD_720p_AAC and AVC_MP4_BL_L31_HD_AAC are
problematic as the player would simply ignore the files and not show
them.
AVC_MP4_HP_HD_AAC works.
All the files play normally from a USB key.
I've noticed as well that NULL works always, and this is the approach I
have followed.
So I changed minidlna and added a flag to disable DLNA_PN, and this
flag is only used for a Samsung BD J5500 in order not to break other
players, which can handle DLNA_PN properly.
So when a J5500 is connected we simply set DLNA_PN to NULL and
everything works well.
FFmpeg 3.0, as used on Ubuntu Yakkety, did not include the codecpar
changes, although it uses the same library major version. So refine the
libavformat version check to sort that out.
Reporting Samsung features to Windows and AllShare somehow makes them
ignore us, so detect these client types specifically and don't expose
Samsung capabilities to them.
Add FLAG_CAPTION_RES to the modern Samsung profile. Older Samsung
devices used a custom method for describing subtitles, but apparently
Series J no longer supports it. The good thing is, they now support
the more standard method (and probably have been for a while, since it
works on my old Series D BDP).
So let's just expose both methods to the client, since everything should
be able to handle it.
Fixes: SF bug #113 (Subtitles support for new 2015 Samsung J series TV)
We shouldn't blindly set the LC_CTYPE to en_US.utf8, because the user may
not have it installed. So if the user already has a utf8 locale defined,
just use it for LC_CTYPE.
Fixed: SF Bug #87 (Problem of accentuation)