* Add an LG quirk to force a dot into the title of videos with subtitles associated with them.
This commit is contained in:
parent
d829df06dc
commit
51ef3a57dd
18
upnpsoap.c
18
upnpsoap.c
@ -713,6 +713,7 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
|
|
||||||
if( strncmp(class, "item", 4) == 0 )
|
if( strncmp(class, "item", 4) == 0 )
|
||||||
{
|
{
|
||||||
|
char *alt_title = NULL;
|
||||||
/* We may need special handling for certain MIME types */
|
/* We may need special handling for certain MIME types */
|
||||||
if( *mime == 'v' )
|
if( *mime == 'v' )
|
||||||
{
|
{
|
||||||
@ -756,6 +757,18 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
strcpy(mime+8, "mkv");
|
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' )
|
else if( *mime == 'a' )
|
||||||
{
|
{
|
||||||
@ -947,12 +960,13 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ELGDevice:
|
case ELGDevice:
|
||||||
if( sql_get_int_field(db, "SELECT ID from CAPTIONS where ID = '%s'", detailID) > 0 )
|
if( alt_title )
|
||||||
{
|
{
|
||||||
ret = strcatf(str, "<res protocolInfo=\"http-get:*:text/srt:*\">"
|
ret = strcatf(str, "<res protocolInfo=\"http-get:*:text/srt:*\">"
|
||||||
"http://%s:%d/Captions/%s.srt"
|
"http://%s:%d/Captions/%s.srt"
|
||||||
"</res>",
|
"</res>",
|
||||||
lan_addr[passed_args->iface].str, runtime_vars.port, detailID);
|
lan_addr[passed_args->iface].str, runtime_vars.port, detailID);
|
||||||
|
free(alt_title);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ESamsungSeriesC:
|
case ESamsungSeriesC:
|
||||||
@ -1091,7 +1105,7 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
|
|||||||
args.filter = set_filter_flags(Filter, h);
|
args.filter = set_filter_flags(Filter, h);
|
||||||
if( args.filter & FILTER_DLNA_NAMESPACE )
|
if( args.filter & FILTER_DLNA_NAMESPACE )
|
||||||
ret = strcatf(&str, 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);
|
ret = strcatf(&str, PV_NAMESPACE);
|
||||||
strcatf(&str, ">\n");
|
strcatf(&str, ">\n");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user