741 Commits

Author SHA1 Message Date
Justin Maggard
0575299a87 tivo: Add Avahi support
TiVo Bolt doesn't support the old TiVo Beacon discovery mechanism, so
we need to support Bonjour discovery now.  Use Avahi if it's available.
2017-04-28 01:18:53 -07:00
Justin Maggard
58a5f61d46 inotify: Don't export unused function
We don't need to export inotify_remove_file(), since it isn't used
anywhere else.
2017-04-28 01:17:18 -07:00
Justin Maggard
f76f060f72 libav: Fix codecpar version check
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.
2017-03-16 12:09:59 -07:00
Justin Maggard
10ae45f53f upnpdescgen: Remove unused variables 2017-03-16 12:09:59 -07:00
Justin Maggard
2301120dd0 inotify: Dynamically increase inotify max watches
If we run out of inotify watches, try dynamically increasing the limit.
2017-02-14 23:54:33 -08:00
Justin Maggard
44f06f4557 inotify: Declare private functions static 2017-02-14 23:24:16 -08:00
Justin Maggard
8a996b4b62 upnphttp: Kill strange HTTP request parsing
Avoid reading uninitialized memory on malicious HTTP requests.

Fixes: Bug #293 - upnphttp.c ProcessHttpQuery_upnphttp() Function HTTP Request Handling Remote DoS
2016-09-28 18:44:58 -07:00
Justin Maggard
da91cb8de2 metadata: add libavformat > 57 compatibility
AVStream will no longer have a AVCodecContext reference after
libavformat major version 57.
2016-09-28 15:02:18 -07:00
Justin Maggard
d1cd7c7a4a Wrap up version 1.1.6. 2016-06-16 14:29:22 -07:00
Justin Maggard
1f46b53030 Remove obsolete PNPX support.
AFAICT this has been abandoned by Microsoft.
2016-04-21 14:38:45 -07:00
Justin Maggard
02b6085380 clients: Add AllShare and Windows detection
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.
2016-04-21 14:31:53 -07:00
Darkvater
5339075393 Update support for LG2012 TV
LG 2012 series does not need '.' in title anymore to be able to show
captions
2016-03-17 14:48:05 -07:00
Eduardo Rocha
126f0f5cb8 Samsung bookmark - go back to the beginning of the movie if less than 30 seconds was played. 2016-03-17 14:48:05 -07:00
Eduardo Rocha
cae3e880d2 Samsung bookmarking: fix for magic containers 2016-03-17 14:48:05 -07:00
Justin Maggard
abc1972600 inotify: fix SQL error when moving captions
Change INSERT to INSERT OR REPLACE when recording caption file moves,
to avoid UNIQUE constraint failures.
2016-03-17 14:48:05 -07:00
Darkvater
910b84bcd6 inotify: missing include file 2016-03-17 14:48:05 -07:00
Justin Maggard
c4166b3e77 options: Add wide_links config option.
In some environments, it makes sense to validate that symlink destinations
remain inside user-defined media_dirs.  Make this behavior configurable.
2016-03-17 14:48:05 -07:00
Justin Maggard
4ec6cd0053 upnpsoap: Fix external subtitles on Samsung Series J.
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)
2016-01-07 00:39:37 -08:00
Justin Maggard
1c5e9ae61c containers: Add gettext support for magic containers.
Run the magic contain names through gettext, so they can get localized.
2015-12-21 11:49:07 -08:00
Justin Maggard
520de165fb nls: Rework NLS init to work with non-en_US locales.
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)
2015-12-21 11:45:10 -08:00
Justin Maggard
c985eee9c7 inotify: Block signals in the inotify thread.
Otherwise, we may get invalid reads due to double-handling of signals.
2015-12-21 11:43:38 -08:00
Justin Maggard
d097d3c02d nls: Move init_nls() after log_init().
Otherwise the DPRINTF in minidlna.c:init_nls() will always fail to log.
Pointed out by Shrimpkin.
2015-11-16 09:57:07 -08:00
Justin Maggard
e008ab04bb Wrap up version 1.1.5. 2015-09-10 12:24:09 -07:00
Justin Maggard
0da13b33f0 flac: Fix fd leak on bad FLAC files.
Some types of bad FLAC files error out early in the metadata parsing phase,
and we weren't properly deleting the iterator if it errored out at that
point.
2015-09-10 11:58:16 -07:00
Justin Maggard
e4dab2455b scanner: Add more vebose scan error message.
Print the errno in addition to the generic error message.
2015-09-10 11:57:31 -07:00
Justin Maggard
c160a8c8fd Fix a couple missed frees on exit.
There were harmless, but we should fix them for correctness.
2015-09-10 11:55:54 -07:00
Justin Maggard
1b75093a43 ssdp: Allow SSDP M-SEARCH from other subnets
Based on a patch from SF user pasdVn <pasdVn3@gmx.de>.

Rely on the kernel to filter out multicasts from non-member interfaces.
Also get the address of the interface we received the multicast on using
sockopt IP_PKTINFO.

Closes: SF Patch ticket #77.
2015-09-08 15:49:22 -07:00
Justin Maggard
916546d45f tagutils: Fix divide-by-zero on bad FLAC files 2015-09-08 14:46:24 -07:00
Justin Maggard
cfab9bd056 locale: Add Korean translations.
Thanks SF user manggong.
2015-08-05 10:28:47 -07:00
Justin Maggard
8f7e760747 utils: Unescape "&apos;" in .nfo files.
Kodi escapes apostrophes when exporting its database to .nfo files.

Fixes: Bug #271 (Handle &apos in .nfo files)
2015-08-03 00:20:45 -07:00
Justin Maggard
f85f5afe65 upnphttp: Fix inadvertently removed line from 8e201fe. 2015-08-02 23:51:07 -07:00
Justin Maggard
98fbb5b98b Fix error message for bad user.
SF Patch #126 (Thanks Maxim).
2015-07-30 16:40:59 -07:00
Justin Maggard
e7ec55a2ad getifaddrs: Fix buffer overrun with >3 interfaces. 2015-07-30 16:25:48 -07:00
Justin Maggard
c29a9cf52b image: Support rotation of monochrome JPEGs.
Extends the existing 90°-increment rotation support
(i.e. /Resized/ID?rotation=DEG) to monochrome JPEGs.

SF Patch #135 (Thanks R.L. Horn).
2015-07-30 15:53:15 -07:00
Darkvater
f09339d95c Fix an issue in trunk with captions
When a browse command is issued multiple files are returned. As soon as one had a caption, all files were marked as having captions because the flag wasn't cleared.

Signed-off-by: Justin Maggard <jmaggard@netgear.com>
2015-07-30 15:45:53 -07:00
Justin Maggard
acac5fb3bc metadata: Handle cover art streams that come after the video stream.
SF patch #140 (`check_embedded_art` not called when Cover Art at end of file)

Using MP4Box, the Cover Art is added after the video stream.

Thanks Mathieu Malaterre.
2015-07-30 15:35:38 -07:00
Justin Maggard
b78c25f260 upnpsoap: Use magic container sort order.
Magic containers can have a pre-defined sort order.  Let's use it by default if
it exists.
2015-07-30 15:10:03 -07:00
Justin Maggard
5a309fc48f inotify: Recognize new hard links.
Based on SF patch #139 (Thanks Alenky Klaus).
2015-07-30 14:54:39 -07:00
Justin Maggard
8e201fec7b upnphttp: Check for invalid Content-Length header. 2015-07-30 13:44:42 -07:00
Justin Maggard
b94f04d6ef upnpsoap: Work around LG TV ordering bug.
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.
2015-07-29 23:58:21 -07:00
Justin Maggard
edbdd9acb4 ssdp: Fix service submit to MiniSSDPd.
SubmitServicesToMiniSSDPD(lan_addr[0].str, runtime_vars.port)
is called before lan_addr[0].str get a proper value.
Patch add call to reload_ifaces() in order to fix that
see miniupnp forum post http://miniupnp.tuxfamily.org/forum/viewtopic.php?t=1801

Thanks Thomas Bernard for this fix.
2015-07-29 23:44:45 -07:00
Justin Maggard
30562d0b66 upnpttp: Implement PixelShape support.
TiVo uses this to get the aspect ratio correct on images.
2015-07-29 23:23:55 -07:00
Anthony DeRobertis
9c5d8c7fd2 Fix memory leak with multi-picture FLAC files.
On my music archive, minidlnad wasn't anywhere near through scanning,
and had already leaked in excess of 10GiB from this.

The basic problem is that song_metadata has one image pointer. When it
sees a picture metadata item, it mallocs some space and copies the
picture to that, then sets the image pointer. That's all well and good,
except FLAC (and some other formats, haven't checked them) allow more
than one picture. So on the second picture, it does the same
thing—except overwriting the previous pointer, thus leaking it.

Simple fix: check if != NULL, ignore picture.

Signed-off-by: Justin Maggard <jmaggard@netgear.com>
2015-07-14 23:11:07 -07:00
Justin Maggard
a294f624e0 inotify: Fix new video file detection for TYPE_AUDIO|TYPE_VIDEO media_dirs.
We were missing a return in one of the cases for the switch.

Patch #150 from user Shrimpkin.
Fixes: Support Request #40 (Inotify don't work when add *.mts video)
2015-06-26 00:03:31 -07:00
Justin Maggard
13d36533b5 cleanup: Declare some unshared functions static. 2015-04-10 15:47:28 -07:00
Justin Maggard
c1bb37a387 clients: Re-enable Samsung DCM10 flag.
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.
2015-04-10 15:33:09 -07:00
Justin Maggard
6630671af0 images: Set DCT method to JDCT_IFAST. 2015-04-10 15:32:32 -07:00
Justin Maggard
ec11819012 upnpsoap: Don't honor the NO_RESIZE flag for thumbnails
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.
2015-04-09 16:57:08 -07:00
Justin Maggard
0845c2193b tivo: Fix title and description escaping. 2015-04-08 23:38:38 -07:00
Justin Maggard
e165dbf7a9 metadata: Properly escape episode titles from nfo files. 2015-04-08 23:27:47 -07:00