* Make a distiction between Samsung A series and later models. We need to trick A series only into playing AVI files.
This commit is contained in:
parent
bec766497a
commit
0cf2e5731a
@ -78,6 +78,7 @@ enum client_types {
|
|||||||
EToshibaTV,
|
EToshibaTV,
|
||||||
ELGDevice,
|
ELGDevice,
|
||||||
ENetgearEVA2000,
|
ENetgearEVA2000,
|
||||||
|
ESamsungSeriesA,
|
||||||
EStandardDLNA150 = 100
|
EStandardDLNA150 = 100
|
||||||
};
|
};
|
||||||
|
|
||||||
|
22
upnphttp.c
22
upnphttp.c
@ -302,13 +302,19 @@ intervening space) by either an integer or the keyword "infinite". */
|
|||||||
h->reqflags |= FLAG_DLNA;
|
h->reqflags |= FLAG_DLNA;
|
||||||
h->reqflags |= FLAG_MIME_AVI_DIVX;
|
h->reqflags |= FLAG_MIME_AVI_DIVX;
|
||||||
}
|
}
|
||||||
else if(strncmp(p, "SamsungWiselinkPro", 18)==0 ||
|
else if(strncmp(p, "SEC_HHP_", 8)==0)
|
||||||
strncmp(p, "SEC_HHP_", 8)==0)
|
|
||||||
{
|
{
|
||||||
h->req_client = ESamsungTV;
|
h->req_client = ESamsungTV;
|
||||||
|
h->reqflags |= FLAG_SAMSUNG;
|
||||||
|
h->reqflags |= FLAG_DLNA;
|
||||||
|
h->reqflags |= FLAG_NO_RESIZE;
|
||||||
|
}
|
||||||
|
else if(strncmp(p, "SamsungWiselinkPro", 18)==0)
|
||||||
|
{
|
||||||
|
h->req_client = ESamsungSeriesA;
|
||||||
|
h->reqflags |= FLAG_SAMSUNG;
|
||||||
h->reqflags |= FLAG_DLNA;
|
h->reqflags |= FLAG_DLNA;
|
||||||
h->reqflags |= FLAG_NO_RESIZE;
|
h->reqflags |= FLAG_NO_RESIZE;
|
||||||
//h->reqflags |= FLAG_MIME_AVI_DIVX;
|
|
||||||
}
|
}
|
||||||
else if(strstrc(p, "bridgeCo-DMP/3", '\r'))
|
else if(strstrc(p, "bridgeCo-DMP/3", '\r'))
|
||||||
{
|
{
|
||||||
@ -1726,10 +1732,16 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
|
|||||||
{
|
{
|
||||||
strncpy(last_file.mime, result[4], sizeof(last_file.mime)-1);
|
strncpy(last_file.mime, result[4], sizeof(last_file.mime)-1);
|
||||||
/* From what I read, Samsung TV's expect a [wrong] MIME type of x-mkv. */
|
/* From what I read, Samsung TV's expect a [wrong] MIME type of x-mkv. */
|
||||||
if( h->req_client == ESamsungTV )
|
if( h->reqflags & FLAG_SAMSUNG )
|
||||||
{
|
{
|
||||||
if( strcmp(last_file.mime+6, "x-matroska") == 0 )
|
if( strcmp(last_file.mime+6, "x-matroska") == 0 )
|
||||||
strcpy(last_file.mime+8, "mkv");
|
strcpy(last_file.mime+8, "mkv");
|
||||||
|
/* Samsung TV's such as the A750 can natively support many
|
||||||
|
Xvid/DivX AVI's however, the DLNA server needs the
|
||||||
|
mime type to say video/mpeg */
|
||||||
|
else if( h->req_client == ESamsungSeriesA &&
|
||||||
|
strcmp(last_file.mime+6, "x-msvideo") == 0 )
|
||||||
|
strcpy(last_file.mime+6, "mpeg");
|
||||||
}
|
}
|
||||||
/* ... and Sony BDP-S370 won't play MKV unless we pretend it's a DiVX file */
|
/* ... and Sony BDP-S370 won't play MKV unless we pretend it's a DiVX file */
|
||||||
else if( h->req_client == ESonyBDP )
|
else if( h->req_client == ESonyBDP )
|
||||||
@ -1781,7 +1793,7 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
|
|||||||
DPRINTF(E_WARN, L_HTTP, "Client tried to specify transferMode as Interactive without an image!\n");
|
DPRINTF(E_WARN, L_HTTP, "Client tried to specify transferMode as Interactive without an image!\n");
|
||||||
/* Samsung TVs (well, at least the A950) do this for some reason,
|
/* Samsung TVs (well, at least the A950) do this for some reason,
|
||||||
* and I don't see them fixing this bug any time soon. */
|
* and I don't see them fixing this bug any time soon. */
|
||||||
if( h->req_client != ESamsungTV || GETFLAG(DLNA_STRICT_MASK) )
|
if( !(h->reqflags & FLAG_SAMSUNG) || GETFLAG(DLNA_STRICT_MASK) )
|
||||||
{
|
{
|
||||||
Send406(h);
|
Send406(h);
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -111,7 +111,8 @@ struct upnphttp {
|
|||||||
#define FLAG_MIME_FLAC_FLAC 0x00800000
|
#define FLAG_MIME_FLAC_FLAC 0x00800000
|
||||||
#define FLAG_NO_RESIZE 0x01000000
|
#define FLAG_NO_RESIZE 0x01000000
|
||||||
#define FLAG_MS_PFS 0x02000000 // Microsoft PlaysForSure client
|
#define FLAG_MS_PFS 0x02000000 // Microsoft PlaysForSure client
|
||||||
#define FLAG_AUDIO_ONLY 0x04000000
|
#define FLAG_SAMSUNG 0x04000000
|
||||||
|
#define FLAG_AUDIO_ONLY 0x08000000
|
||||||
|
|
||||||
#define FLAG_FREE_OBJECT_ID 0x00000001
|
#define FLAG_FREE_OBJECT_ID 0x00000001
|
||||||
|
|
||||||
|
12
upnpsoap.c
12
upnpsoap.c
@ -346,14 +346,14 @@ mime_to_ext(const char * mime, char * buf)
|
|||||||
#define FILTER_UPNP_SEARCHCLASS 0x00100000
|
#define FILTER_UPNP_SEARCHCLASS 0x00100000
|
||||||
|
|
||||||
static u_int32_t
|
static u_int32_t
|
||||||
set_filter_flags(char * filter, enum client_types client)
|
set_filter_flags(char * filter, struct upnphttp *h)
|
||||||
{
|
{
|
||||||
char *item, *saveptr = NULL;
|
char *item, *saveptr = NULL;
|
||||||
u_int32_t flags = 0;
|
u_int32_t flags = 0;
|
||||||
|
|
||||||
if( !filter || (strlen(filter) <= 1) )
|
if( !filter || (strlen(filter) <= 1) )
|
||||||
return 0xFFFFFFFF;
|
return 0xFFFFFFFF;
|
||||||
if( client == ESamsungTV )
|
if( h->reqflags & FLAG_SAMSUNG )
|
||||||
flags |= FILTER_DLNA_NAMESPACE;
|
flags |= FILTER_DLNA_NAMESPACE;
|
||||||
item = strtok_r(filter, ",", &saveptr);
|
item = strtok_r(filter, ",", &saveptr);
|
||||||
while( item != NULL )
|
while( item != NULL )
|
||||||
@ -393,7 +393,7 @@ set_filter_flags(char * filter, enum client_types client)
|
|||||||
else if( strcmp(item, "upnp:albumArtURI") == 0 )
|
else if( strcmp(item, "upnp:albumArtURI") == 0 )
|
||||||
{
|
{
|
||||||
flags |= FILTER_UPNP_ALBUMARTURI;
|
flags |= FILTER_UPNP_ALBUMARTURI;
|
||||||
if( client == ESamsungTV )
|
if( h->reqflags & FLAG_SAMSUNG )
|
||||||
flags |= FILTER_UPNP_ALBUMARTURI_DLNA_PROFILEID;
|
flags |= FILTER_UPNP_ALBUMARTURI_DLNA_PROFILEID;
|
||||||
}
|
}
|
||||||
else if( strcmp(item, "upnp:albumArtURI@dlna:profileID") == 0 )
|
else if( strcmp(item, "upnp:albumArtURI@dlna:profileID") == 0 )
|
||||||
@ -694,7 +694,7 @@ callback(void *args, int argc, char **argv, char **azColName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* From what I read, Samsung TV's expect a [wrong] MIME type of x-mkv. */
|
/* From what I read, Samsung TV's expect a [wrong] MIME type of x-mkv. */
|
||||||
if( passed_args->client == ESamsungTV )
|
if( passed_args->flags & FLAG_SAMSUNG )
|
||||||
{
|
{
|
||||||
if( strcmp(mime+6, "x-matroska") == 0 )
|
if( strcmp(mime+6, "x-matroska") == 0 )
|
||||||
{
|
{
|
||||||
@ -992,7 +992,7 @@ BrowseContentDirectory(struct upnphttp * h, const char * action)
|
|||||||
str.off = sprintf(str.data, "%s", resp0);
|
str.off = sprintf(str.data, "%s", resp0);
|
||||||
/* See if we need to include DLNA namespace reference */
|
/* See if we need to include DLNA namespace reference */
|
||||||
args.iface = h->iface;
|
args.iface = h->iface;
|
||||||
args.filter = set_filter_flags(Filter, h->req_client);
|
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);
|
||||||
@ -1169,7 +1169,7 @@ SearchContentDirectory(struct upnphttp * h, const char * action)
|
|||||||
str.off = sprintf(str.data, "%s", resp0);
|
str.off = sprintf(str.data, "%s", resp0);
|
||||||
/* See if we need to include DLNA namespace reference */
|
/* See if we need to include DLNA namespace reference */
|
||||||
args.iface = h->iface;
|
args.iface = h->iface;
|
||||||
args.filter = set_filter_flags(Filter, h->req_client);
|
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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user