Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforce.net>2011-12-16 23:36:40 +0400
committerJustin Maggard <jmaggard@users.sourceforce.net>2011-12-16 23:36:40 +0400
commit9284691b0a6bf9aa377c21278d52c9f4c6d0ea30 (patch)
tree9b834cbf75b7a268461e13fc77b7093bce2fc395
parent5543af47a03bb8d080f07e06429211550383cc4d (diff)
* Add an LG quirk to force a dot into the title of videos with subtitles associated with them.
-rw-r--r--upnpsoap.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/upnpsoap.c b/upnpsoap.c
index 4004009..7ebb80d 100644
--- a/upnpsoap.c
+++ b/upnpsoap.c
@@ -713,6 +713,7 @@ callback(void *args, int argc, char **argv, char **azColName)
if( strncmp(class, "item", 4) == 0 )
{
+ char *alt_title = NULL;
/* We may need special handling for certain MIME types */
if( *mime == 'v' )
{
@@ -756,6 +757,18 @@ callback(void *args, int argc, char **argv, char **azColName)
strcpy(mime+8, "mkv");
}
}
+ /* LG hack: subtitles won't get used unless dc:title contains a dot. */
+ else if( passed_args->client == ELGDevice && (passed_args->filter & FILTER_RES) )
+ {
+ if( sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%s'", detailID) > 0 )
+ {
+ ret = asprintf(&alt_title, "%s.", title);
+ if( ret > 0 )
+ title = alt_title;
+ else
+ alt_title = NULL;
+ }
+ }
}
else if( *mime == 'a' )
{
@@ -947,12 +960,13 @@ callback(void *args, int argc, char **argv, char **azColName)
}
break;
case ELGDevice:
- if( sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%s'", detailID) > 0 )
+ if( alt_title )
{
ret = strcatf(str, "&lt;res protocolInfo=\"http-get:*:text/srt:*\"&gt;"
"http://%s:%d/Captions/%s.srt"
"&lt;/res&gt;",
lan_addr[passed_args->iface].str, runtime_vars.port, detailID);
+ free(alt_title);
}
break;
case ESamsungSeriesC:
@@ -1091,7 +1105,7 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
args.filter = set_filter_flags(Filter, h);
if( args.filter & FILTER_DLNA_NAMESPACE )
ret = strcatf(&str, DLNA_NAMESPACE);
- if( args.filter & FILTER_PV_SUBTITLE_FILE_TYPE|FILTER_PV_SUBTITLE_FILE_URI )
+ if( args.filter & (FILTER_PV_SUBTITLE_FILE_TYPE|FILTER_PV_SUBTITLE_FILE_URI) )
ret = strcatf(&str, PV_NAMESPACE);
strcatf(&str, "&gt;\n");