options: Add enable_subtitles config option
Enable generic subtitle support by default for unknown clients. Set the new enable_subtitles option to false to revert to the old behavior.
This commit is contained in:
parent
33fd018828
commit
8bdba2f40d
@ -756,6 +756,10 @@ init(int argc, char **argv)
|
||||
if (strcasecmp(ary_options[i].value, "beacon") == 0)
|
||||
CLEARFLAG(TIVO_BONJOUR_MASK);
|
||||
break;
|
||||
case ENABLE_SUBTITLES:
|
||||
if (!strtobool(ary_options[i].value))
|
||||
CLEARFLAG(SUBTITLES_MASK);
|
||||
break;
|
||||
default:
|
||||
DPRINTF(E_ERROR, L_GENERAL, "Unknown option in file %s\n",
|
||||
optionsfile);
|
||||
|
@ -88,3 +88,7 @@ model_number=1
|
||||
|
||||
# set this to yes to allow symlinks that point outside user-defined media_dirs.
|
||||
#wide_links=no
|
||||
|
||||
# enable subtitle support by default on unknown clients.
|
||||
# note: the default is yes
|
||||
#enable_subtitles=yes
|
||||
|
@ -171,10 +171,14 @@ force_sort_criteria=+upnp:class,+upnp:originalTrackNumber,+dc:title
|
||||
Set to 'yes' to allow symlinks that point outside user-defined media_dirs.
|
||||
By default, wide symlinks are not followed.
|
||||
|
||||
.IP "\fBenable_subtitles\fP"
|
||||
Set to 'no' to disable subtitle support on unknown clients.
|
||||
By default, subtitles are enabled for unknown or generic clients.
|
||||
|
||||
|
||||
|
||||
.SH VERSION
|
||||
This manpage corresponds to minidlna version 1.0.25
|
||||
This manpage corresponds to minidlna version 1.3.0
|
||||
|
||||
.SH AUTHOR
|
||||
.nf
|
||||
|
@ -67,6 +67,7 @@ static const struct {
|
||||
{ MERGE_MEDIA_DIRS, "merge_media_dirs" },
|
||||
{ WIDE_LINKS, "wide_links" },
|
||||
{ TIVO_DISCOVERY, "tivo_discovery" },
|
||||
{ ENABLE_SUBTITLES, "enable_subtitles" },
|
||||
};
|
||||
|
||||
int
|
||||
|
@ -60,6 +60,7 @@ enum upnpconfigoptions {
|
||||
MERGE_MEDIA_DIRS, /* don't add an extra directory level when there are multiple media dirs */
|
||||
WIDE_LINKS, /* allow following symlinks outside the defined media_dirs */
|
||||
TIVO_DISCOVERY, /* TiVo discovery protocol: bonjour or beacon. Defaults to bonjour if supported */
|
||||
ENABLE_SUBTITLES, /* Enable generic subtitle support for all clients by default */
|
||||
};
|
||||
|
||||
/* readoptionsfile()
|
||||
|
@ -58,7 +58,7 @@
|
||||
time_t startup_time = 0;
|
||||
|
||||
struct runtime_vars_s runtime_vars;
|
||||
uint32_t runtime_flags = INOTIFY_MASK | TIVO_BONJOUR_MASK;
|
||||
uint32_t runtime_flags = INOTIFY_MASK | TIVO_BONJOUR_MASK | SUBTITLES_MASK;
|
||||
|
||||
const char *pidfilename = "/var/run/minidlna/minidlna.pid";
|
||||
|
||||
|
@ -195,6 +195,7 @@ extern uint32_t runtime_flags;
|
||||
#endif
|
||||
#define SCANNING_MASK 0x0100
|
||||
#define RESCAN_MASK 0x0200
|
||||
#define SUBTITLES_MASK 0x0400
|
||||
|
||||
#define SETFLAG(mask) runtime_flags |= mask
|
||||
#define GETFLAG(mask) (runtime_flags & mask)
|
||||
|
@ -839,6 +839,10 @@ callback(void *args, int argc, char **argv, char **azColName)
|
||||
if( *mime == 'v' )
|
||||
{
|
||||
dlna_flags |= DLNA_FLAG_TM_S;
|
||||
if (GETFLAG(SUBTITLES_MASK) &&
|
||||
(passed_args->client >= EStandardDLNA150 || !passed_args->client))
|
||||
passed_args->flags |= FLAG_CAPTION_RES;
|
||||
|
||||
if( passed_args->flags & FLAG_MIME_AVI_DIVX )
|
||||
{
|
||||
if( strcmp(mime, "video/x-msvideo") == 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user