* Add Sony BDP-S370 MKV support, by pretending they're DiVX files.

This commit is contained in:
Justin Maggard 2010-10-05 23:54:07 +00:00
parent 4ecfe18bb8
commit 091b90daa7
3 changed files with 23 additions and 2 deletions

View File

@ -43,6 +43,7 @@ enum client_types {
EFreeBox, EFreeBox,
EPopcornHour, EPopcornHour,
EMediaRoom, EMediaRoom,
ESonyBDP,
EStandardDLNA150 = 100 EStandardDLNA150 = 100
}; };

View File

@ -286,17 +286,22 @@ intervening space) by either an integer or the keyword "infinite". */
else if(strncasecmp(line, "X-AV-Client-Info", 16)==0) else if(strncasecmp(line, "X-AV-Client-Info", 16)==0)
{ {
/* Skip client detection if we already detected it. */ /* Skip client detection if we already detected it. */
if( h->req_client ) if( h->req_client && h->req_client < EStandardDLNA150 )
goto next_header; goto next_header;
p = colon + 1; p = colon + 1;
while(isspace(*p)) while(isspace(*p))
p++; p++;
if(strstr(p, "PLAYSTATION 3")) if(strstrc(p, "PLAYSTATION 3", '\r'))
{ {
h->req_client = EPS3; h->req_client = EPS3;
h->reqflags |= FLAG_DLNA; h->reqflags |= FLAG_DLNA;
h->reqflags |= FLAG_MIME_AVI_DIVX; h->reqflags |= FLAG_MIME_AVI_DIVX;
} }
else if(strstrc(p, "Blu-ray Disc Player", '\r'))
{
h->req_client = ESonyBDP;
h->reqflags |= FLAG_DLNA;
}
} }
else if(strncasecmp(line, "Transfer-Encoding", 17)==0) else if(strncasecmp(line, "Transfer-Encoding", 17)==0)
{ {
@ -1671,6 +1676,13 @@ SendResp_dlnafile(struct upnphttp * h, char * object)
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");
} }
/* ... and Sony BDP-S370 won't play MKV unless we pretend it's a DiVX file */
else if( h->req_client == ESonyBDP )
{
if( strcmp(last_file.mime+6, "x-matroska") == 0 ||
strcmp(last_file.mime+6, "mpeg") == 0 )
strcpy(last_file.mime+6, "divx");
}
} }
else else
{ {

View File

@ -622,6 +622,14 @@ callback(void *args, int argc, char **argv, char **azColName)
strcpy(mime+8, "mkv"); strcpy(mime+8, "mkv");
} }
} }
else if( passed_args->client == ESonyBDP )
{
if( strcmp(mime+6, "x-matroska") == 0 ||
strcmp(mime+6, "mpeg") == 0 )
{
strcpy(mime+6, "divx");
}
}
} }
else if( *mime == 'a' ) else if( *mime == 'a' )
{ {