The UPnP protocol specification mandates that subscribers can request a
callback to an arbitrary URL. This recently resulted in CVE-2020-12695
(CallStranger) outlining the risk of information disclosure and DoS
attacks.
This commit ensures that the callback URL sent in a SUBSCRIBE request
points to the same IP address that made the request.
If our response buffer fills up to the max buffer size on a UPnP Browse
request, we should return short results rather than erroring out.
Fixes: #314 (Cannot browse MiniDLNA 1.2.1 with VLC 2.2.6 (UPnPError 709: Unsupported or invalid sort criteria))
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.
get_pix() returns opaque black pixels for out-of-bounds coordinates, resulting
in spurious averages at the edges. The attached patch appears to fix the
problem, at least for the floating-point resizers.
From SF user R.L. Horn.
Add Album Artist AAC metadata parsing contributed by SF user knono549.
Then, change music metadata gathering code to use either Album Artist
or Band as upnp:artist.
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.
OpenBSD moved all machine architectures to long long time_t in the last
release which triggered a crash in minidlna's scanner on 32-bit systems.
Reported-by: Stuart Henderson
Add subtitle support for NetFront™ Living Connect middleware-based
clients. These appear to include devices from Panasonic, Philips,
Vizio, Sony, and probably more.
I'm not entirely sure what this flag enables. But there are reports
that is breaks browsing on Samsung Series F TV's. So we'll have to
disable for now, until that gets sorted out by people who actually
have Samsung TV's.
Newer version of libavformat can grab cover art, so we'll go ahead
and use it. We also need to make sure we don't confuse cover art
with a normal video stream.
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.
By default, if there are multiple media directories specified, there
will be entries for each one in the root directory container. If
there is only one media directory specified, then just its contents
will be in the root container, to save one level of browsing.
Setting this option changes the default behavior so that multiple
media dirs will behave like a single media dir.
Advertising the DCM10 vendor-specific feature to Samsung Series
C and D (at least) players causes them to always browse ContainerID
1, no matter which section is chosen from their GUI.
Treat TVs and BDPs as separate client types with unique features.
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.
At least some Panasonic clients try to open more than 5 simultaneous
connections to the server. If we keep the default of 5 max children,
it results in choppy playback on those clients.
Make this setting configurable, and default to 50 max connections.
Our process is pretty lightweight, so 50 children should not be a
problem on most systems.
If an interface comes online after startup, we really need to send a
complete byebye + alive set on that interface, but we don't want to do
it for other interfaces. So do it as the interfaces come up, and
skip it for interfaces that existed before the reload.